This library takes the current time (which must be set to UTC, e.g. via an NTP call), and applies a timezone definition (loaded at startup) to calculate the local time. This includes the handling of daylight saving. See http://mbed.org/users/hlipka/notebook/time-zone-handling/ for more information (esp. how to get a time zone definition file).

Dependents:   CubiScan 000-FIN_youcef 005_ESSAI_youcef

Embed: (wiki syntax)

« Back to documentation index

Time Class Reference

Time Class Reference

This class handles the time zone calculation, and is used for creating time stamp objects. More...

#include <Time.h>

Public Member Functions

 Time ()
 creates a new Time instance.
TimeStampgetTime ()
 creates a new TimeStamp instance.
long getUnixTime ()

Detailed Description

This class handles the time zone calculation, and is used for creating time stamp objects.

Definition at line 197 of file Time.h.


Constructor & Destructor Documentation

Time (  )

creates a new Time instance.

On the first call, it reads the file 'timezone.csv' from the USB disk (local file system).

Definition at line 83 of file Time.cpp.


Member Function Documentation

TimeStamp * getTime (  )

creates a new TimeStamp instance.

The caller is responsible for deleting it afterwards!

Returns:
the time stamp

Definition at line 164 of file Time.cpp.

long getUnixTime (  )
Returns:
the current time stamp (UTC) in UNIX format, without time zone correction.