Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Time Zone (Word 2000-2003)

    We need to insert a time stamp in documents that always reflects the Pacific Time zone. Is there a way to do this from within Word? I know how to parse the date and time and format it however we want, but not sure if we can get the current time zone and then do the calculations to change it to Pacific Time.

    Thank you!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Time Zone (Word 2000-2003)

    You'd need to write VBA code that uses a Windows API function or reads the Windows Registry to obtain the time zone the PC is in, and to calculate whether daylight saving time is in effect, then adjust for Pacific Time. This is far from trivial, see the thread starting at <post:=531,501>post 531,501</post:> if you want to get an idea of what you'd have to do.
    And of course, if the PC's clock is off, or has been set for the wrong time zone, the result of such calculations would be incorrect too.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Time Zone (Word 2000-2003)

    Hans,

    Although I've not looked at them in a long time and don't have them on this computer, couldn't one use macropod's date/time and date field math "tools" to do this? Perhaps an assumption is needed as to the time zone the computer is in to subtract/add a constant number of hours - I guess that's the need for the API call. As far as daylight savings time, if the computer is in the US, then whatever is obtained for the time zone the computer is in would apply all over. If not (since I don't know the rules elsewhere and the US is changing again), then one would need some rules to examine the date to determine whether the Pacific Time zone (and the rest of the US) is in a different daylight savings "status" then the one in which the computer is located.

    Fred

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Time Zone (Word 2000-2003)

    Aren't there states in the USA that don't have DST? (Arizona, Hawaii)

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Time Zone (Word 2000-2003)

    Yes but I'm assuming that the computer setting the timestamp is in a known location; that wasn't clear in the original posting. So for example if the computer is in one of those states, that can be taken into account.

    Some states that are in the western part of the time zone do not use DST.

    Fred

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Time Zone (Word 2000-2003)

    In many situations, it may be possible to add/subtract a fixed offset to/from the local time to obtain Pacific Time. For users traveling a lot with a laptop, a more flexible approach will be needed. JeanieB can decide what she needs.

Posting Permissions

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