![]() |
PIP 5.5.3
Platform-Independent Primitives
|
Calendar date and time. More...
#include <pidatetime.h>
Public Member Functions | |
| PIDateTime () | |
| Construct null PIDateTime. | |
| PIDateTime (const PITime &time) | |
| Construct PIDateTime from PITime and null PIDate. | |
| PIDateTime (const PIDate &date) | |
| Construct PIDateTime from PIDate and null PITime. | |
| PIDateTime (const PIDate &date, const PITime &time) | |
| Construct PIDateTime from PIDate and PITime. | |
| PIDateTime | normalized () const |
| Returns normalized PIDateTime. | |
| void | normalize () |
| Normalize all fields. | |
| PIString | toString (const PIString &format="d.MM.yyyy h:mm:ss") const |
| Returns string representation. | |
| time_t | toSecondSinceEpoch () const |
| Returns seconds since 1 Jan 1970. | |
| PISystemTime | toSystemTime () const |
| Returns time as PISystemTime. | |
| PIDate | date () const |
| Returns date part. | |
| PITime | time () const |
| Returns time part. | |
| void | setDate (const PIDate &d) |
| Set date part. | |
| void | setTime (const PITime &t) |
| Set time part. | |
| void | operator+= (const PIDateTime &d1) |
| Sum operator. | |
| void | operator-= (const PIDateTime &d1) |
| Subtract operator. | |
Static Public Member Functions | |
| static PIDateTime | fromString (PIString string, PIString format="d.MM.yyyy h:mm:ss") |
| Returns PIDateTime from string representation. | |
| static PIDateTime | fromSecondSinceEpoch (const time_t sec) |
| Construct PIDateTime from seconds since 1 Jan 1970. | |
| static PIDateTime | fromSystemTime (const PISystemTime &st) |
| Construct PIDateTime from PISystemTime. | |
| static PIDateTime | current () |
| Returns current date and time. | |
Public Attributes | |
| int | year |
| Year. | |
| int | month |
| Month, 1-12. | |
| int | day |
| Day, 1-31. | |
| int | hours |
| Hour, 0-23. | |
| int | minutes |
| Minutes, 0-59. | |
| int | seconds |
| Seconds, 0-59. | |
| int | milliseconds |
| Milliseconds, 0-999. | |
Calendar date and time.