Quintiq file version 2.0
|
#parent: #root
|
Method PTF_GetClientTimeZoneOffset () as String id:Method_LibPTF_pnlTestController_PTF_GetClientTimeZoneOffset
|
{
|
#keys: '[131464.1.896601338]'
|
Body:
|
[*
|
// convert date time to string (based on client timezone)
|
timezoneOffsetLength := 5;
|
timezoneOffsetMask := "Z";
|
dateTimeFormatWithTimezoneOffset := "dd-MMM-yyyy HH:mm:ss" + timezoneOffsetMask;
|
|
converter := DateTimeToString::UserConverter();
|
converter.SetCustomConversion();
|
converter.CustomFormatString( dateTimeFormatWithTimezoneOffset );
|
|
// Any time will do, the purpose is to able to get the timezone offset, example: +0800
|
nowAsStringWithTimezoneOffset := converter.Convert( DateTime::Now() );
|
|
|
strTimezoneOffset := nowAsStringWithTimezoneOffset.SubString( nowAsStringWithTimezoneOffset.Length() - timezoneOffsetLength, timezoneOffsetLength );
|
return strTimezoneOffset;
|
*]
|
}
|