Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::LocalDateTime Class Reference

#include <LocalDateTime.h>

List of all members.


Detailed Description

This class represents an instant in local time (as opposed to UTC), expressed in years, months, days, hours, minutes, seconds and milliseconds based on the Gregorian calendar.

In addition to the date and time, the class also maintains a time zone differential, which denotes the difference in seconds from UTC to local time, i.e. UTC = local time - time zone differential.

Although LocalDateTime supports relational and arithmetic operators, all date/time comparisons and date/time arithmetics should be done in UTC, using the DateTime or Timestamp class for better performance. The relational operators normalize the dates/times involved to UTC before carrying out the comparison.

Definition at line 50 of file LocalDateTime.h.


Public Member Functions

LocalDateTimeassign (int tzd, double julianDay)
LocalDateTimeassign (int tzd, int year, int month, int day, int hour, int minute, int second, int millisecond, int microseconds)
LocalDateTimeassign (int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microseconds=0)
 Assigns a Julian day in the local time zone.
int day () const
int dayOfWeek () const
 Returns the day witin the month (1 to 31).
int dayOfYear () const
int hour () const
int hourAMPM () const
 Returns the hour (0 to 23).
bool isAM () const
 Returns the hour (0 to 12).
bool isPM () const
 Returns true if hour < 12;.
double julianDay () const
 Returns the microsecond (0 to 999).
 LocalDateTime (const LocalDateTime &dateTime)
 LocalDateTime (int tzd, double julianDay)
 Creates a LocalDateTime for the given Julian day in the local time zone.
 LocalDateTime (double julianDay)
 LocalDateTime (int tzd, const DateTime &dateTime)
 LocalDateTime (const DateTime &dateTime)
 LocalDateTime (int tzd, int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond)
 LocalDateTime (int year, int month, int day, int hour=0, int minute=0, int second=0, int millisecond=0, int microsecond=0)
int microsecond () const
 Returns the millisecond (0 to 999).
int millisecond () const
 Returns the second (0 to 59).
int minute () const
 Returns true if hour >= 12.
int month () const
 Returns the year.
bool operator!= (const LocalDateTime &dateTime) const
LocalDateTime operator+ (const Timespan &span) const
LocalDateTimeoperator+= (const Timespan &span)
Timespan operator- (const LocalDateTime &dateTime) const
LocalDateTime operator- (const Timespan &span) const
LocalDateTimeoperator-= (const Timespan &span)
bool operator< (const LocalDateTime &dateTime) const
bool operator<= (const LocalDateTime &dateTime) const
LocalDateTimeoperator= (double julianDay)
 Assigns a timestamp.
LocalDateTimeoperator= (const Timestamp &timestamp)
 Assigns another LocalDateTime.
LocalDateTimeoperator= (const LocalDateTime &dateTime)
 Destroys the LocalDateTime.
bool operator== (const LocalDateTime &dateTime) const
 Returns the UTC equivalent for the local date and time.
bool operator> (const LocalDateTime &dateTime) const
bool operator>= (const LocalDateTime &dateTime) const
int second () const
 Returns the minute (0 to 59).
void swap (LocalDateTime &dateTime)
Timestamp timestamp () const
 Returns the UTC equivalent for the local date and time.
int tzd () const
 Returns the julian day for the date.
DateTime utc () const
 Returns the time zone differential.
Timestamp::UtcTimeVal utcTime () const
 Returns the date and time expressed as a Timestamp.
int week (int firstDayOfWeek=DateTime::MONDAY) const
 Returns the month (1 to 12).
int year () const
 Swaps the LocalDateTime with another one.
 ~LocalDateTime ()
 Copy constructor. Creates the LocalDateTime from another one.

Protected Member Functions

 LocalDateTime (Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff, int tzd)

Private Attributes

DateTime _dateTime
int _tzd

Friends

class DateTimeFormatter
class DateTimeParser

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

Generated by  Doxygen 1.6.0   Back to index