core/timestamp.c File Reference


Detailed Description

Id
timestamp.c 1187 2009-01-02 18:58:48Z dchassin
Copyright (C) 2008 Battelle Memorial Institute

Definition in file timestamp.c.

Go to the source code of this file.

Defines

#define DAY   (86400*TS_SECOND)
 the number of ticks in one day
#define HOUR   (3600*TS_SECOND)
 the number of ticks in one hour
#define MICROSECOND   (TS_SECOND/1000000)
 the number of ticks in one microsecond
#define MINUTE   (60*TS_SECOND)
 the number of ticks in one minute
#define SECOND   (TS_SECOND)
 the number of ticks in one second

Functions

TIMESTAMP compute_dstevent (int year, SPEC *spec, time_t offset)
 Computes the GMT time of a DST event Offset indicates the time offset to include.
int convert_from_timestamp (TIMESTAMP ts, char *buffer, int size)
 Convert from a timestamp to a string.
TIMESTAMP convert_to_timestamp (char *value)
 Convert from a string to a timestamp.
int isdst (TIMESTAMP t)
 Determine whether a GMT timestamp is under DST rules.
void load_tzspecs (char *tz)
 Load a timezone from the timezone info file.
int local_datetime (TIMESTAMP ts, DATETIME *dt)
 Converts a GMT timestamp to local datetime struct Adjusts to TZ if possible.
int local_tzoffset (TIMESTAMP t)
 Calculate the current TZ offset in seconds.
TIMESTAMP mkdatetime (DATETIME *dt)
 Convert a datetime struct into a GMT timestamp.
void set_tzspec (int year, char *tzname, SPEC *pStart, SPEC *pEnd)
 Apply a timezone spec to the current tz rules.
int strdatetime (DATETIME *t, char *buffer, int size)
 Convert a datetime struct to a string.
char * timestamp_current_timezone (void)
 Read the current timezone specification.
char * timestamp_set_tz (char *tz_name)
 Establish the default timezone for time conversion.
int timestamp_test (void)
 Test the daylight saving time calculations.
int timestamp_year (TIMESTAMP ts, TIMESTAMP *remainder)
 Determine the year of a GMT timestamp Apply remainder if given.
char * tz_dst (char *tzspec)
 Get the std timezone name.
int tz_info (char *tzspec, char *tzname, char *std, char *dst, time_t *offset)
 Extract information from an ISO timezone specification.
char * tz_name (char *tzspec)
 Converts a timezone spec into a standard timezone name Populate tzspec if provided, otherwise returns a static buffer.
time_t tz_offset (char *tzspec)
 Compute the offset of a tz spec.
char * tz_std (char *tzspec)
 Get the std timezone name.


GridLAB-DTM Version 2.0
An open-source project initiated by the US Department of Energy