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")
 
no time stamp as in
<messageTimestamp>20041803161306527000+660</messageTimestamp>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

timestamp 1
Getting System Ticks 3
timestamp purpose and use if it 3
easy app.config question 2
Compare timespan of Files? 1
Windows Vista How to validify timestamp 0
>> sql timestamp 4
TimeStamp 2

Back
Top