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)

  2. Eyup
    Eyup avatar
    2941 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(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,
    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. DevCraft R3 2016 release webinar banner
Back to Top