Advertisement
Milotronik

WebService DateTime

Jun 8th, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 0.39 KB | None | 0 0
  1.     [WebMethod]
  2.     public String fechaHoy()
  3.     {
  4.         return DateTime.Now.ToString("d"); //"d" muestra solo la fecha, vacio muestra fecha y hora.
  5.     }
  6. ////////////////aspx
  7.  <div id="fecha"  runat="server">
  8. ////////////////aspx.cs
  9. protected void Page_Load(object sender, EventArgs e)
  10.     {
  11.         WebService ws = new WebService();
  12.         fecha.InnerHtml = ws.fechaHoy();
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement