• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 447
  • Last Modified:

Windows regional time setting

I'm trying to customize an Access application that stores appointment date/times in a SharePoint list.

Unfortunately, I've got users all over the US that are using this application.  What I want to happen is that when the user selects 10am, and then saves the record, the value that actually gets saved will be in GMT.  So I need a way to convert a local time to GMT.  I'm assuming that the best way to do this is via an api call or by capturing a registry setting.  Just not sure how to accomplish this.

I'll either use the forms Current event or a conversion function in a query to convert the saved date/time back to local time for display purposes
Dale Fye
Dale Fye
1 Solution
Rey Obrero (Capricorn1)Commented:
Gustav BrockCIOCommented:
Here is full code and how to do. Just pick the right page at EE:

Convert PST time to GMT

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

I'll go one better, since you need multiple zones across the continent
was the source
<singing, it's all been done before>
For my machine it returns "Mountain Daylight Time"

  wYear As Integer
  wMonth As Integer
  wDayOfWeek As Integer
  wDay As Integer
  wHour As Integer
  wMinute As Integer
  wSecond As Integer
  wMilliseconds As Integer
End Type

        Bias As Long
        StandardName(32) As Integer
        StandardDate As SYSTEMTIME
        StandardBias As Long
        DaylightName(32) As Integer
        DaylightDate As SYSTEMTIME
        DaylightBias As Long
End Type

Declare Function GetTimeZoneInformation Lib "kernel32.dll" (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long

Function TimeZoneString() As String
' Display the name of the time zone the computer is set to.
Dim tzi As TIME_ZONE_INFORMATION  ' receives information on the time zone
Dim retval As Long  ' return value
Dim c As Long  ' counter variable needed to display time zone name
Dim TheZone As String

retval = GetTimeZoneInformation(tzi)  ' read information on the computer's selected time zone

' Oddly, instead of being stored in a string, the time zone name is stored in a
' 32-element array, each element holding the ASCII code of one of the characters.
' This loop converts the array into a readable string.
For c = 0 To 31  ' the array's range is from 0 to 31
  If tzi.StandardName(c) = 0 Then Exit For  ' abort if the terminating null character is reached
  TheZone = TheZone & Chr(tzi.StandardName(c)) ' convert the ASCII code into a character
Next c
TimeZoneString = TheZone
End Function

Form there, it's a select case structure and you're done
Dale FyeAuthor Commented:
not abandoned, just side-tracked.  Will get back to you.
Dale FyeAuthor Commented:

This worked like a charm.  Thanks

Don't know how I failed to close this sooner
No problem
No problem

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now