Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2002
    Location
    Washington State
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formating Date according to Time Zone.

    I am working on trying to get a script where it will display the date and time in a format that I want. I already have a script for time, where it takes the time now from the server and -2 hours (which works for my time zone). The only problem I have is this:

    Lets say that it's 9:59pm (using my -2 time code) the server time is 11:59pm. Now when the server goes to 12:00am the date changes. However my time script says it's 10:00pm.

    I am wondering if there is a way to make the date obey my time script and not change dates at 10:00pm. Any comments or suggestions would greatly be appreciated. Thanks.


    ~Isaac~
    ~ Isaac Lloyd ~
    Website Design & Development
    http://www.IsaacLloyd.com

  • #2
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    session.LCID = whatever locale you want to display or
    http://support.microsoft.com/kb/q229690/ shows you how to serve the correct time according to the users browser language settings

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I am wondering if there is a way to make the date obey my time script and not change dates at 10:00pm. Any comments or suggestions would greatly be appreciated.
    Here's a snippet of code I've used to do something similar:

    mintServerToOrgHourOffset = 2 ' Server is Pacific Time and org is Central Time.
    mvarOrgCurDtTime = DateAdd("H", mintServerToOrgHourOffset, Now())
    mvarOrgCurDt = DateValue(mvarOrgCurDtTime)
    mvarOrgCurTime = TimeValue(mvarOrgCurDtTime)
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips


  •  

    Posting Permissions

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