Saturday, 15 June 2013

c# - Getting date and time in a trimmed way -


I want to include a date and time in DB in a format like this:

"May 20, 2013 at 5:45"

And if I want to show it in the format 2 minutes earlier, now, or 6 months ago etc., how can I do it .. :)

Can anyone suggest how to do this,

Thank you in advance.

Although its date / date data is completely false to store data, but you specify the format You can use the ToString overload to:

  var stringedDate = DateTime Now. Two strings ("DD MM ',' Yay '' H ':' MM ');    

No comments:

Post a Comment