Topic Path: Pending > DateTimeToGmtOffSetStr@TDateTime@Boolean
ContentsIndexHome
PreviousUpNext
DateTimeToGmtOffSetStr@TDateTime@Boolean

Retrieves the GMT time offset for a date/time value.

Parameters 
Description 
ADateTime 
Value to be converted to a GMT offset string.
 
SubGMT 
Add the prefix "GMT" to the return value. 

String - The offset from GMT time as a string.

DateTimeToGmtOffSetStr is a String function used to return the time difference for the ADateTime parameter as an Internet Time difference string. The time difference contains the number of hours and minutes needed to adjust a time value the local timezone to GMT (Greenwich Mean Time). The return value for DateTimeToGmtOffSetStr is expressed in one of the following forms: 

 

Value 
Meaning 
GMT 
Same as GMT, offset is 0 hours and 0 minutes. 
-0500 
Local time is 5 hours and 0 minutes earlier than GMT. 
+0130 
Local time is 1 hour and 30 minutes later than GMT. 

 

ADateTime is the native Date/Time value containing the number of hours and minutes to use for the local timezone. ADateTime is not a complete Date/Time value. 

SubGMT indicates that the return value should substitute the prefix " " for a time difference string where the offet is 0 hours and 0 minutes. When SubGMT is True, the prefix is used as the time difference string, otherwise the prefix is omitted. 

DateTimeToGmtOffSetStr calls DecodeTime to extract the hour and minute components of ADateTime. When ADateTime contains a negative offset, the return value is formatted using the convention: 

 

-HHMM

 

When ADateTime contains a positive offset, the return value is formatted using the convention: 

 

+HHMM

 

Where HH represents the 2-digit number of hours in the offset, and MM represents the 2-digit number of minutes in the offset. 

To convert an Internet GMT difference string to a TDateTime value that can be used in Date arithmetic operations, use the GmtOffsetStrToDateTime function.

Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.