Getting the client time zone info

An office wanted to know a way of finding a client's time zone for a global application being currently developed.

This Content Component encountered an error
Here's a way of getting/setting time zone information from a Lotus Notes Client using Win32 API calls with GetTimeZoneInformation and SetTimeZoneInformation from the kernel32.dll. An office wanted to know a way of finding a client's time zone for a global application being currently developed.
'type declarations for System time and timezoneinfo structures
Type SYSTEMTIME
	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
Type TIMEZONEINFO
	Bias As Long 
	StandardName As  String * 32
	StandardDate As SYSTEMTIME
	StandardBias As Long 
	DaylightName As String * 32
	DaylightDate As SYSTEMTIME
	DaylightBias As Long 
End Type
'win32 API calls. needed to declare timezoneinfo as unicode to translate return string to wchar
Declare Function getTimeZoneInfo& Lib "kernel32" Alias "GetTimeZoneInformation" (tzs As Unicode TIMEZONEINFO)
Declare Function setTimeZoneInfo% Lib "kernel32" Alias "SetTimeZoneInformation" (tzs As Unicode TIMEZONEINFO)

Sub Click(Source As Button)
        'declare a timezoneinfo structure
	Dim tz As TIMEZONEINFO
        'call c call
	rc&=getTimeZoneInfo(tz)
        'display time zone
	Msgbox tz.StandardName
End Sub
This was first published in July 2001

Dig deeper on Domino Resources - Part 4

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close