SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Displaying Time

  1. #1
    SitePoint Enthusiast aldomatic's Avatar
    Join Date
    Dec 2006
    Location
    Big D
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Displaying Time

    Im a noob at .net or asp. I would like to display the server time on my page like so "June 5, 2008".

    Any help is appreciated.

    edit: I ment displaying the date not time.

    Aldo
    Last edited by aldomatic; Jun 5, 2008 at 11:46. Reason: Post title was different

  2. #2
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,873
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    Hi

    You can use DateTime.Now.ToLongDateString();

    You can also specify the format u want if that doesnt show as u want like this:
    DateTime.Now.ToString("MMMM d, yyyy");

  3. #3
    SitePoint Guru Wullie's Avatar
    Join Date
    Oct 2002
    Location
    Greenock, Scotland
    Posts
    701
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yip, just what NightStalker said. If you want more information on formattign strings and how can customise the formatting in detail, check out http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
    ASP.NET Freelance Web Developer
    Bored? Check out my photography folio at Flickr


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •