How to get Today date in Number format in server side

Thread is closed for posting
2 posts, 0 answers
  1. Tamim
    Tamim avatar
    64 posts
    Member since:
    May 2011

    Posted 04 Jun 2012 Link to this post

    How to get Current date in Number format in server side e.g. Year/Month/day( 20120604000000)

    Thanks
    Tamim
  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 06 Jun 2012 Link to this post

    Hi Tamim,

    Please try the following:
    DateTime dt = DateTime.Now;
    StringBuilder sb = new StringBuilder();
     
    sb.Append(dt.Year);
    sb.Append(string.Format("{0:00}",dt.Month));
    sb.Append(string.Format("{0:00}", dt.Day));
    sb.Append(string.Format("{0:00}", dt.Hour));
    sb.Append(string.Format("{0:00}", dt.Minute));
    sb.Append(string.Format("{0:00}", dt.Second));
             
    string time = sb.ToString();

    That should do the trick.

    All the best,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top