Re: printing time in log messages
- From: Chuck D <ChuckD@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 14 Oct 2008 11:14:02 -0700
The page peter posted is the best reference. Personally I prefer
System.DateTime.Now.ToString("HH:mm:ss");
our systems are in UTC
System.DateTime.UTCNow.ToString("HH:mm:ss");
"zacks@xxxxxxxxxxxxxxxxxxxxxxxx" wrote:
On Oct 14, 1:51 pm, puzzlecracker <ironsel2...@xxxxxxxxx> wrote:.
I have this string string time =
System.DateTime.Now.ToLongTimeString(); it is equal to 1:00:22 PM
I need it to be 13:00:22
Any suggestions how to format it?
Thanks
string.Format("{0:HH}:{1:mm}:{2:ss}", Now, Now, Now)
This is just one of many ways it can be done.
- References:
- printing time in log messages
- From: puzzlecracker
- Re: printing time in log messages
- From: zacks
- printing time in log messages
- Prev by Date: Re: printing time in log messages
- Next by Date: Re: Process.BeginErrorReadLine and BeginOutputReadLine; buffer not flushed?
- Previous by thread: Re: printing time in log messages
- Next by thread: Re: printing time in log messages
- Index(es):