LocalTimeRK
Public Member Functions | Data Fields
LocalTimePosixTimezone Class Reference

Parses a Posix timezone string into its component parts. More...

#include <LocalTimeRK.h>

Public Member Functions

 LocalTimePosixTimezone ()
 Default constructor (no timezone set)
 
virtual ~LocalTimePosixTimezone ()
 Destructor.
 
 LocalTimePosixTimezone (const char *str)
 Constructs the object with a specified timezone configuration. More...
 
void clear ()
 Clears the timezone setting in this object.
 
bool parse (const char *str)
 Parses the timezone configuration string. More...
 
bool hasDST () const
 Returns true if this timezone configuration has daylight saving.
 
bool isValid () const
 Returns true if this timezone configuration has been set and appears valid.
 
bool isZ () const
 Returns true if this timezone configuration is UTC.
 

Data Fields

String dstName
 Daylight saving timezone name (empty string if no DST)
 
LocalTimeHMS dstHMS
 Daylight saving time shift (relative to UTC)
 
String standardName
 Standard time timezone name.
 
LocalTimeHMS standardHMS
 Standard time shift (relative to UTC). Note that this is positive in the United States, which is kind of backwards.
 
LocalTimeChange dstStart
 Rule for when DST starts.
 
LocalTimeChange standardStart
 Rule for when standard time starts.
 
bool valid = false
 true if the configuration looks valid
 

Detailed Description

Parses a Posix timezone string into its component parts.

For the Eastern US timezone, the string is: "EST5EDT,M3.2.0/2:00:00,M11.1.0/2:00:00"

There are many other acceptable formats, including formats for locations that don't have DST.

For more information, see: https://developer.ibm.com/technologies/systems/articles/au-aix-posix/

Constructor & Destructor Documentation

◆ LocalTimePosixTimezone()

LocalTimePosixTimezone::LocalTimePosixTimezone ( const char *  str)

Constructs the object with a specified timezone configuration.

Calls parse() internally.

Member Function Documentation

◆ parse()

bool LocalTimePosixTimezone::parse ( const char *  str)

Parses the timezone configuration string.

Parameters
strThe string, for example: "EST5EDT,M3.2.0/2:00:00,M11.1.0/2:00:00"

If the string is not valid this function returns false and the valid flag will be clear. You can call isValid() to check the validity at any time (such as if you are using the constructor with a string that does not return a boolean).


The documentation for this class was generated from the following files: