Page 1 of 1

Timezone

Posted: Sat Jan 21, 2006 11:34 am
by Marc Vanzegbroeck
I was wondering if I can check the timezone with FW?
I am looking for u function that is returning something like GMT +01:00

Thanks,
Marc

Posted: Sun Jan 22, 2006 8:44 am
by Antonio Linares
Marc,

The Win32 API function to use is GetTimeZoneInformation().

Posted: Sun Jan 22, 2006 11:14 am
by Marc Vanzegbroeck
Antonio,

Thanks, I have use Treg32 to read the info from the registry.

Marc

Posted: Sun Jan 22, 2006 8:03 pm
by James Bott
Can we see your code for this?

Posted: Sun Jan 22, 2006 10:24 pm
by Marc Vanzegbroeck
It was posted on the old FW NG:
Here it is:

Code: Select all

function timezone()
   Local oReg, ret_val
   oReg := TReg32():New(HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Control\TimeZoneInformation", .f. )
   ret_val := oReg:Get( "Bias", 0 )
   oReg:Close()
   ret_val := Round( ret_val / 60, 0 ) * -1
Return ret_val
Marc

Posted: Mon Jan 23, 2006 8:26 am
by Antonio Linares
Marc,

Ok, we have added it to the FW library. Thanks.