Hi folks,
does somebody know a way to get the TimeZone from the system? In gpc.pas, the procedure UnitTimeToTime wants it as a parameter, so I want to fill in a reasonable value.
Besides, the function expects parameters named DST, TZName1, and TZName2. Can somebody tell me what they mean and how to find reasonable values for them?
Thanks,
Markus
On Tue, Apr 01, 2003 at 05:15:28PM +0200, Markus Gerwinski wrote:
Hi folks,
does somebody know a way to get the TimeZone from the system? In gpc.pas, the procedure UnitTimeToTime wants it as a parameter, so I want to fill in a reasonable value.
Besides, the function expects parameters named DST, TZName1, and TZName2. Can somebody tell me what they mean and how to find reasonable values for them?
There are fields with the same name in the TimeStamp record, i.e. use can obtain reasonable values for them from GetTimeStamp. However, they are _output_ parameters of UnixTimeToTime, so you don't need to worry about them at all. (It seems to me that `function UnixTimeToTime (T: UnixTimeType): TimeStamp' would be a more clear interface.)
DST means Daylight Saving Time. TZName{1,2} are apparently names of the time zone (as strings), but I've no idea why there are two of them.
Emil
Thanks,
Markus
Emil Jerabek wrote:
On Tue, Apr 01, 2003 at 05:15:28PM +0200, Markus Gerwinski wrote:
Hi folks,
does somebody know a way to get the TimeZone from the system? In gpc.pas, the procedure UnitTimeToTime wants it as a parameter, so I want to fill in a reasonable value.
Besides, the function expects parameters named DST, TZName1, and TZName2. Can somebody tell me what they mean and how to find reasonable values for them?
There are fields with the same name in the TimeStamp record, i.e. use can obtain reasonable values for them from GetTimeStamp. However, they are _output_ parameters of UnixTimeToTime, so you don't need to worry about them at all.
In fact, as the comment says, all parameters except Time may be Null (if you don't care for them).
(It seems to me that `function UnixTimeToTime (T: UnixTimeType): TimeStamp' would be a more clear interface.)
Something like UnixTimeToTimeStamp?
DST means Daylight Saving Time. TZName{1,2} are apparently names of the time zone (as strings), but I've no idea why there are two of them.
Without and with DST.
Eike Lange wrote:
TimeZone is the number of seconds west from Greenwich.
No, east. (See the recent discussion.)
Frank
On Tue, Apr 01, 2003 at 08:10:39PM +0200, Frank Heckenbach wrote:
Emil Jerabek wrote:
On Tue, Apr 01, 2003 at 05:15:28PM +0200, Markus Gerwinski wrote:
Hi folks,
does somebody know a way to get the TimeZone from the system? In gpc.pas, the procedure UnitTimeToTime wants it as a parameter, so I want to fill in a reasonable value.
Besides, the function expects parameters named DST, TZName1, and TZName2. Can somebody tell me what they mean and how to find reasonable values for them?
There are fields with the same name in the TimeStamp record, i.e. use can obtain reasonable values for them from GetTimeStamp. However, they are _output_ parameters of UnixTimeToTime, so you don't need to worry about them at all.
In fact, as the comment says, all parameters except Time may be Null (if you don't care for them).
(It seems to me that `function UnixTimeToTime (T: UnixTimeType): TimeStamp' would be a more clear interface.)
Something like UnixTimeToTimeStamp?
Oops, I didn't know about this procedure.
Emil
Hi folks,
thanks for your answers, everybody. :-) Say, why is TimeStamp defined in gpc-bp.pas instead of gpc.pas? Would it affect the usability of my units, if (when they use TimeStamp) someone uses them and disables borland extensions?
Best,
Markus
Markus Gerwinski wrote:
thanks for your answers, everybody. :-) Say, why is TimeStamp defined in gpc-bp.pas instead of gpc.pas? Would it affect the usability of my units, if (when they use TimeStamp) someone uses them and disables borland extensions?
There seems to be a misunderstanding about gpc-bp (please read the comments in that unit).
`TimeStamp' is built-in. BTW, all built-in identifiers and keywords are listed in the `Reference' section of the manual. (At least insofar the manual is complete, though not all of them have descriptions.)
Frank
On Tue, Apr 01, 2003 at 05:15:28PM +0200, Markus Gerwinski wrote:
Besides, the function expects parameters named DST, TZName1, and TZName2. Can somebody tell me what they mean and how to find reasonable values for them?
program Foo; var t: TimeStamp; begin GetTimeStamp (t); WriteLn (t.TimeZone, ' ', t.TZName1, ' ', t.TZName2) end.
TimeZone is the number of seconds west from Greenwich.
Eike