homepage Welcome to WebmasterWorld Guest from 184.73.104.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Displaying Time
rcshield

5+ Year Member



 
Msg#: 4013916 posted 12:17 am on Oct 27, 2009 (gmt 0)

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

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4013916 posted 12:21 am on Oct 27, 2009 (gmt 0)

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

WebmasterWorld Administrator 10+ Year Member



 
Msg#: 4013916 posted 2:02 pm on Oct 27, 2009 (gmt 0)

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

Reference:
DateTimeFormatInfo Class [msdn.microsoft.com]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved