Forum Moderators: open

Message Too Old, No Replies

Displaying Time

         

rcshield

12:17 am on Oct 27, 2009 (gmt 0)

10+ Year Member



Hello:
How do I display the current time (just a timestamp, not dynamic) on a Web page using ASP.NET (with seconds)?

Example: 5:00:52

g1smd

12:21 am on Oct 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Will it display the server time and time zone, or the users time and time zone?

Does it need date as well, or just time?

Will it be 24-hour or 12-hour am/pm time?

Ocean10000

2:02 pm on Oct 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



DateTime.Now.ToString("HH:mm:ss")

Reference:
DateTimeFormatInfo Class [msdn.microsoft.com]