CONVERTTIMESTAMP Procedure The CONVERTTIMESTAMP procedure converts a Greenwich mean time (GMT) timestamp to or from a local-time-based timestamp within any accessible node in the network. A local timestamp can be in local standard time (LST), which does not include daylight saving time (DST), or in local civil time (LCT), which does include DST. DST is a system to extend the amount of daylight available during summer months by advancing the clock one hour. In most states in the United States, DST begins at 2:00 a.m. on the first Sunday in April and ends at 2:00 a.m. DST (1:00 a.m. LST) on the last Sunday in October. ret-time := CONVERTTIMESTAMP ( julian-timestamp ! i ,[ direction ] ! i ,[ node ] ! i ,[ error ] ); ! o ret-time returned value FIXED returns the converted Julian timestamp. julian-timestamp input FIXED:value is a four-word Julian timestamp to be converted. direction input INT:value indicates what time form or timestamp to return. You can specify one of the following values for direction. 0 GMT to LCT 1 GMT to LST 2 LCT to GMT 3 LST to GMT If direction is omitted, 0 is used. If direction is out of range, a value of -3 is returned in error. node input INT:value is the number of the node at which the conversion is to take place. If the node parameter is omitted or -1, the caller's node is used. If the specified node does not exist, the value of ret-time is not changed. error output INT:ref:1 returns one of the following values: -5 Value of node is out of range -4 Timestamp not supplied or has invalid value -3 Invalid value supplied for direction -2 Impossible LCT -1 Ambiguous LCT 0 No errors, successful 1 DST range error 2 DST table not loaded >2 File-system error (attempting to reach [) CONSIDERATIONS * A local timestamp can be in either of two forms: LCT (with DST correction) or LST (without DST correction). * Network and local timestamp Local timestamp (with LCT and LST) should be used with caution if any network use is anticipated. The reason is that another node can be in another time zone or in an area with different DST rules (LCT only). * LCT timestamps LCT timestamps should be used with caution because of the negative adjustment that DST systems dictate. Timestamp base conversion (for example, LCT) is provided by the operating system. * A 64-bit Julian timestamp is based on the Julian Date. It is a quantity equal to the number of microseconds since January 1, 4713 B.C., 12:00 (noon) Greenwich mean time (Julian proleptic calendar). This timestamp can represent either Greenwich mean time, local standard time, or local civil time. There is no way to examine a Julian timestamp and determine which of the three times it represents. Procedures that work with the 64-bit Julian timestamp are COMPUTETIMESTAMP, CONVERTTIMESTAMP, INTERPRETTIMESTAMP, JULIANTIMESTAMP, and SETSYSTEMCLOCK. For a more complete description of 48-bit and 64-bit timestamps, refer to the TIMESTAMP or JULIANTIMESTAMP procedure. * Prior to 1987, DST in the United States started on the last Sunday in April; starting with 1987, DST begins on the first Sunday in April. Timestamps occurring prior to 1987 are correctly converted in accordance with the previous standard. EXAMPLE RETURN^TIME^BASE := CONVERTTIMESTAMP ( JULIAN , , SYSTEM^NUM ); SYNTAX FOR C PROGRAMMERS #include long long CONVERTTIMESTAMP( long long julian-timestamp ,[ short direction ] ,[ short node ] ,[ short *error ] );