setting local time

Last post 06-05-2008 2:08 AM by ReyN. 1 replies.

Sort Posts:

  • setting local time

    05-15-2008, 10:58 PM
    • Member
      9 point Member
    • oakman
    • Member since 07-27-2007, 8:29 PM
    • Posts 12

    Hi,
    How do you set the local time? For example, Site last hit:- 5/15/2008 7:49:08 PM at the bottom is the site is the local time for the server (which is GoDaddy), but I live in a different state with different time zone. Is there any way to accomplish this. Thank you.

    Regards,
    Oakkar

     

    Filed under:
  • Re: setting local time

    06-05-2008, 2:08 AM
    • Contributor
      2,118 point Contributor
    • ReyN
    • Member since 07-28-2002, 6:53 AM
    • Pilipinas
    • Posts 413
    hello

    The easiest way would be to use simple client-side JavaScript, as in:

    var today = new Date ( ); 
    and display that accordingly 

    But if you want or need to display the client local time in the desired culture-specific formatting, that takes a bit more work.

    Currently there is no property or method in any class or namespace that can directly return this value, but you can use a combination of UtcNow and certain properties and methods of the TimeZone class along with a simple javascript function

    maybe a working demo can help Big Smile

    Reynald V. Nuñez
    aspxtreme
Page 1 of 1 (2 items)