logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

PQlocalTZInfo - Gets the local machine´s timezone information.

Author

       A  contribution  of eSilo, LLC. for the PostgreSQL Database Management System.  Written by Andrew Chernow
       and Merlin Moncure.

Description

       This function retrieves the local machine´s timezone information.

       If  the  t  argument is not NULL, it represents a time_t value to get timezone information for.  If it is
       NULL, the current time is used.

       The gmtoff argument will be pointed at the number of seconds from GMT, same  value  as  the  GNU  (struct
       tm).tm_gmtoff extension.

       The  isdst  argument  will  be  pointed  at zero if in standard time, one if in daylight savings time and
       negative one if unknown.

       The tzabbrp argument will be pointed at the timezone abbreviation, like PST, ADT, EST, etc..

Examples

       This example gets the local timezone information for a file´s modified time.

              intgmtoff;intisdst;char*tzabbr;structstatst;stat("report.xml",&st);PQlocalTZInfo(&st.st_mtime,&gmtoff,&isdst,&tzabbr);

Name

       PQlocalTZInfo - Gets the local machine´s timezone information.

Rationale

       libpqtypes needs the ability to get the local machine´s timezone information for the datetime data types.
       It later became apparent that a portable way of getting timezone  information  was  very  useful  and  in
       demand.  Thus, this function was made public.

Reporting Bugs

       Report bugs to <libpqtypes@esilo.com>.

Return Value

       None.

See Also

pqt-specs(3)

libpqtypes                                            2011                                      PQlocalTZInfo(3)

Synopsis

#include<libpqtypes.h>voidPQlocalTZInfo(time_t*t,int*gmtoff,int*isdst,char**tzabbrp);

See Also