timestamp in .net

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Hi guys

How do I generate a timestamp in .net ?

I can't seem to find anything on it. I would've thought it would be in
DateTime but it isn't.

thanks
Tom
 
Tom,

If you mean you want the current time try the static System.DateTime.Now
property:
DateTime now = System.DateTime.Now;
MessageBox.Show(now.ToString());

Otherwise, please explain a bit further what you want do to.
 
For a string that is chronologically sortable, try this:
System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ff")
 
Back
Top