Inheritance diagram for sword::Date:

Public Methods | |
| Date () throw () | |
| Default constructor, creates an empty date. | |
| Date (const Date &rhs) throw () | |
| Copy constructor. | |
| Date & | operator= (const Date &rhs) throw () |
| copy operator | |
| Date (word day, word month, word year, word hour, word minute, word second, word millis, const Calendar &calendar) throw () | |
| Builds a date from 'dmy h:m:s' components. | |
| Date (word day, word month, word year, word hour, word minute, word second, word millis) throw () | |
| Builds a date from 'dmy h:m:s' components. | |
| Date (word day, word month, word year, const Calendar &calendar) throw () | |
| Builds a date from 'dmy' components. | |
| Date (word day, word month, word year) throw () | |
| Builds a date from 'dmy' components. | |
| Date (Time time, const Calendar &calendar) | |
| Builds a date from a Time timestamp. | |
| Date (Time time) | |
| Builds a date from a Time timestamp. | |
| Date (int packed, const Calendar &calendar) | |
| Builds a date from its packed int representation (ddmmyyyy). | |
| Date (int packed) | |
| Builds a date from its packed int representation (ddmmyyyy). | |
| word | day () const throw () |
| day of the month read accessor (1..31) | |
| word | month () const throw () |
| month read accessor (1..12) | |
| word | year () const throw () |
| year read accessor (absolute value, eg. 2003) | |
| word | hour () const throw () |
| hour read accessor (0..23) | |
| word | minute () const throw () |
| minute read accessor (0..59) | |
| word | second () const throw () |
| second read accessor (0..59) | |
| word | millis () const throw () |
| milliseconds read accessor (0..999) | |
| const Calendar & | calendar () const throw () |
| calendar used for time-date conversions | |
| word | weekDay () const |
| day of the week read accessor (0=Sunday..6=Saturday) | |
| word | weekNumber () const |
| week number (1..52) | |
| word | dayWithinYear () const |
| day within the year (1..366) | |
| void | day (word value) throw () |
| day of the month write accessor (1..31) | |
| void | month (word value) throw () |
| month write accessor (1..12) | |
| void | year (word value) throw () |
| year write accessor (absolute value, eg. 2003) | |
| void | hour (word value) throw () |
| hour write accessor (0..23) | |
| void | minute (word value) throw () |
| minute write accessor (0..59) | |
| void | second (word value) throw () |
| second write accessor (0..59) | |
| void | millis (word value) throw () |
| milliseconds write accessor (0..999) | |
| bool | empty () const throw () |
| Is this date the empty date ? | |
| void | clear () throw () |
| Clear this date to the empty date. | |
| void | set (word day, word month, word year, word hour, word minute, word second, word millis, const Calendar &calendar) throw () |
| Set the date to these dmy h:m:s components. | |
| void | set (word day, word month, word year, const Calendar &calendar) throw () |
| Set the date to these dmy components (the hour is assumed to be 0:0:0). | |
| void | addYears (int years, bool endToEnd=false) |
| Adds the given number of years to the date. | |
| void | addMonths (int months, bool endToEnd=false) |
| Adds the given number of months to the date. | |
| void | addDays (int days) |
| Adds the given number of days to the date. | |
| void | addHours (int hours) |
| Adds the given number of hours to the date. | |
| void | addMinutes (int minutes) |
| Adds the given number of minutes to the date. | |
| void | addSeconds (int seconds) |
| Adds the given number of seconds to the date. | |
| void | addMillis (int millis) |
| Adds the given number of milliseconds to the date. | |
| void | next () |
| Compute the next day. | |
| void | prev () |
| Compute the previous day. | |
| void | fromTime (Time time, const Calendar &calendar) |
| Explodes a Time timestamp into a Date. | |
| void | fromTime (Time time) |
| Explodes a Time timestamp into a Date. | |
| Time | toTime () const |
| Implodes a Date into a Time timestamp. | |
| void | fromPackedDate (int packed, const Calendar &calendar) |
| Explodes an int into a Date, ex: 20030430 = 30th april 20003. | |
| void | fromPackedDate (int packed) |
| Explodes an int into a Date, ex: 20030430 = 30th april 20003. | |
| int | toPackedDate () const |
| Imploses a Date into an int date ex: 20030430 = 30th april 20003. | |
| bool | valid () const |
| Checks whether this date is a valid date. | |
| std::string | toString (const std::string &format) const |
| Prints a date onto a string using a custom format. | |
| void | fromString (const std::string &format, const std::string &data) |
| Extracts a date from a formatted string. | |
| bool | operator< (const Comparable< Date > &rhs) const |
| '<' operation between this instance and rhs | |
| bool | operator<= (const Comparable< Date > &rhs) const |
| '<=' operation between this instance and rhs | |
| bool | operator> (const Comparable< Date > &rhs) const |
| '>' operation between this instance and rhs | |
| bool | operator>= (const Comparable< Date > &rhs) const |
| '>=' operation between this instance and rhs | |
| bool | operator== (const Comparable< Date > &rhs) const |
| '==' operation between this instance and rhs | |
| bool | operator!= (const Comparable< Date > &rhs) const |
| '!=' operation between this instance and rhs | |
Static Public Methods | |
| Date | now (const Calendar &calendar) |
| Get the current date, in local time. | |
| Date | now () |
| Get the current date, in local time. | |
| Date | nowUTC (const Calendar &calendar) |
| Get the current date, in UTC. | |
| Date | nowUTC () |
| Get the current date, in UTC. | |
| int | compare (const Date &lhs, const Date &rhs) |
| Comparison method (used for Ordered<> implementation). | |
Static Public Attributes | |
| const char * | formatRFC822UTC |
| const char * | formatRFC822 |
|
|
Default constructor, creates an empty date.
|
|
|
Copy constructor.
|
|
||||||||||||||||||||||||||||||||||||
|
Builds a date from 'dmy h:m:s' components.
|
|
||||||||||||||||||||||||||||||||
|
Builds a date from 'dmy h:m:s' components. The calendar is assumed to be the Gregorian calendar |
|
||||||||||||||||||||
|
Builds a date from 'dmy' components. The hour is assume to be 0:0:0. |
|
||||||||||||||||
|
Builds a date from 'dmy' components. The hour is assumed to be 0:0:0, and the calendar is assumed to be the Gregorian calendar |
|
||||||||||||
|
Builds a date from a Time timestamp.
|
|
|
Builds a date from a Time timestamp. The calendar is assumed to be the Gregorian calendar |
|
||||||||||||
|
Builds a date from its packed int representation (ddmmyyyy).
|
|
|
Builds a date from its packed int representation (ddmmyyyy). The calendar is assumed to be the Gregorian calendar |
|
|
Adds the given number of days to the date.
|
|
|
Adds the given number of hours to the date.
|
|
|
Adds the given number of milliseconds to the date.
|
|
|
Adds the given number of minutes to the date.
|
|
||||||||||||
|
Adds the given number of months to the date. The number of months can be negative to go back in time. It can be also 0 which is equivalent to a no-operation. The 'endToEnd' flag specifies whether the end of the months should be preserved. |
|
|
Adds the given number of seconds to the date.
|
|
||||||||||||
|
Adds the given number of years to the date. The number of years can be negative to go back in time. It can be also 0 which is equivalent to a no-operation. The 'endToEnd' flag specifies whether the end of the month should be preserved. For instance, with endToEnd = false, 28feb1995 plus 1 year equals 28feb1996. On the contrary, with endToEnd = true, the result would be 29feb1996. |
|
|
calendar used for time-date conversions
|
|
|
Clear this date to the empty date.
|
|
||||||||||||
|
Comparison method (used for Ordered<> implementation).
|
|
|
day of the month write accessor (1..31)
|
|
|
day of the month read accessor (1..31)
|
|
|
day within the year (1..366)
|
|
|
Is this date the empty date ?
|
|
|
Explodes an int into a Date, ex: 20030430 = 30th april 20003.
|
|
||||||||||||
|
Explodes an int into a Date, ex: 20030430 = 30th april 20003.
|
|
||||||||||||
|
Extracts a date from a formatted string. The format string must conform the format syntax as described in Date::toString. The data is parsed and every formatter is matched against the formatted text. |
|
|
Explodes a Time timestamp into a Date. The Gregorian calendar is used by default. |
|
||||||||||||
|
Explodes a Time timestamp into a Date.
|
|
|
hour write accessor (0..23)
|
|
|
hour read accessor (0..23)
|
|
|
milliseconds write accessor (0..999)
|
|
|
milliseconds read accessor (0..999)
|
|
|
minute write accessor (0..59)
|
|
|
minute read accessor (0..59)
|
|
|
month write accessor (1..12)
|
|
|
month read accessor (1..12)
|
|
|
Compute the next day.
|
|
|
Get the current date, in local time. The calendar is assumed to be the Gregorian calendar.
|
|
|
Get the current date, in local time.
|
|
|
Get the current date, in UTC. The calendar is assumed to be the Gregorian calendar.
|
|
|
Get the current date, in UTC.
|
|
|
'!=' operation between this instance and rhs
|
|
|
'<' operation between this instance and rhs
|
|
|
'<=' operation between this instance and rhs
|
|
|
copy operator
|
|
|
'==' operation between this instance and rhs
|
|
|
'>' operation between this instance and rhs
|
|
|
'>=' operation between this instance and rhs
|
|
|
Compute the previous day.
|
|
|
second write accessor (0..59)
|
|
|
second read accessor (0..59)
|
|
||||||||||||||||||||
|
Set the date to these dmy components (the hour is assumed to be 0:0:0).
|
|
||||||||||||||||||||||||||||||||||||
|
Set the date to these dmy h:m:s components.
|
|
|
Imploses a Date into an int date ex: 20030430 = 30th april 20003.
|
|
|
Prints a date onto a string using a custom format. The format string may contain the following codes (inspired from PHP date() function) together with normal characters that will be directly copied into the output string:
|
|
|
Implodes a Date into a Time timestamp.
|
|
|
Checks whether this date is a valid date.
|
|
|
day of the week read accessor (0=Sunday..6=Saturday) This method will require that the attached calendar implements the WesternCalendar interface, otherwise it will throw an 'bad_cast' exception. |
|
|
week number (1..52)
|
|
|
year write accessor (absolute value, eg. 2003)
|
|
|
year read accessor (absolute value, eg. 2003)
|
1.3-rc2