From GridLAB-D Wiki
Jump to: navigation, search

DATETIME - Local time data container

Synopsis

typedef struct s_datetime {
       unsigned short year; /**< year (1970 to 2970 is allowed) */
       unsigned short month; /**< month (1-12) */
       unsigned short day; /**< day (1 to 28/29/30/31) */
       unsigned short hour; /**< hour (0-23) */
       unsigned short minute; /**< minute (0-59) */
       unsigned short second; /**< second (0-59) */
       unsigned int microsecond; /**< usecond (0-999999) */
       unsigned short is_dst; /**< 0=std, 1=dst */
       char tz[5]; /**< ptr to tzspec timezone id */
       unsigned short weekday; /**< 0=Sunday */
       unsigned short yearday; /**< 0=Jan 1 */
       TIMESTAMP timestamp; /**< GMT timestamp */
} DATETIME;

Remarks

The DATETIME structure is used to store local times. Local times are different from global times stored in TIMESTAMP structures because local times consider timezone and daylight-savings/summer time offsets. Global times are always stored in seconds since January 1, 1970 00:00:00 UTC.

See also