Foxit PDF SDK

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
foxit::DateTime Class Reference

Inherits Object.

## Public Member Functions
| DateTime ()
| Constructor.
| DateTime (const DateTime &dt)
| Constructor, with another date and time object. More...
| DateTime (const FXCRT_DATETIMEZONE &time)
| Constructor, with FXCRT_DATETIMEZONE object. More...
| DateTime (uint16 year, uint16 month, uint16 day, uint16 hour, uint16 minute, uint16 second, uint16 milliseconds, int16 utc_hour_offset, uint16 utc_minute_offset)
| Constructor, with parameters. More...
bool | IsValid () const
| Check whether current object is valid or not. More...
| operator FXCRT_DATETIMEZONE () const
| Convert to a FXCRT_DATETIMEZONE object.
bool | operator!= (const DateTime &datetime) const
| Not equal operator. More...
bool | operator< (const DateTime &datetime) const
| Smaller operator. More...
bool | operator<= (const DateTime &datetime) const
| Smaller or equal operator. More...
DateTime & | operator= (const DateTime &dt)
| Assign operator. More...
bool | operator== (const DateTime &datetime) const
| Equal operator. More...
bool | operator> (const DateTime &datetime) const
| Greater operator. More...
bool | operator>= (const DateTime &datetime) const
| Greater or equal operator. More...
void | Set (uint16 year, uint16 month, uint16 day, uint16 hour, uint16 minute, uint16 second, uint16 milliseconds, int16 utc_hour_offset, uint16 utc_minute_offset)
| Set value. More...
DateTime & | ToLocalTime ()
| Convert current object to local time. More...
DateTime & | ToUTCTime ()
| Convert current object to UTC time. More...

## Static Public Member Functions
static DateTime | GetLocalTime ()
| Get local time. More...
static DateTime | GetUTCTime ()
| Get UTC time. More...

## Public Attributes
uint16 | day
| Day of month. Valid range: from 1 to 31.
uint16 | hour
| Hour. Valid range: from 0 to 23.
uint16 | milliseconds
| Millisecond. Valid range: from 0 to 999. PDF standard does not support now, this can be omitted if it is not applicable.
uint16 | minute
| Minute. Valid range: from 0 to 59.
uint16 | month
| Month. Valid range: from 1 to 12.
uint16 | second
| Second. Valid range: from 0 to 60. 60 for leap second.
int16 | utc_hour_offset
| Hour of time zone. Valid range: from -12 to 12. More...
uint16 | utc_minute_offset
| Minute of time zone. Valid range: from 0 to 59.
uint16 | year
| Year. It should be a four-digit number, such as 2014.

## Detailed Description

This class represents date, time and timezone.

## Constructor & Destructor Documentation

## ◆ DateTime() [1/3]

foxit::DateTime::DateTime | ( | uint16 | year,
|  | uint16 | month,
|  | uint16 | day,
|  | uint16 | hour,
|  | uint16 | minute,
|  | uint16 | second,
|  | uint16 | milliseconds,
|  | int16 | utc_hour_offset,
|  | uint16 | utc_minute_offset
| ) |  |
| inline

Constructor, with parameters.

Parameters

  [in] | year | Year. It should be a four-digit number, such as 2014.
  [in] | month | Month. Valid range: from 1 to 12.
  [in] | day | Day of month. Valid range: from 1 to 31.
  [in] | hour | Hour. Valid range: from 0 to 23.
  [in] | minute | Minute. Valid range: from 0 to 59.
  [in] | second | Second. Valid range: from 0 to 60. 60 for leap second.
  [in] | milliseconds | Millisecond. Valid range: from 0 to 999. PDF standard does not support now, this can be omitted if it is not applicable.
  [in] | utc_hour_offset | Hour of time zone. Valid range: from -12 to 12. Positive value for the eastern time zone, and negative value for the western time zone.
  [in] | utc_minute_offset | Minute of time zone. Valid range: from 0 to 59.

## ◆ DateTime() [2/3]

foxit::DateTime::DateTime | ( | const FXCRT_DATETIMEZONE & | time | ) |
| explicit

Constructor, with FXCRT_DATETIMEZONE object.

Parameters

  [in] | time | A FXCRT_DATETIMEZONE object.

## ◆ DateTime() [3/3]

foxit::DateTime::DateTime | ( | const DateTime & | dt | ) |
| inline

Constructor, with another date and time object.

Parameters

  [in] | dt | Another date and time object.

## Member Function Documentation

## ◆ GetLocalTime()

static DateTime foxit::DateTime::GetLocalTime | ( |  | ) |
| static

Get local time.

Returns
  Local time.

## ◆ GetUTCTime()

static DateTime foxit::DateTime::GetUTCTime | ( |  | ) |
| static

Get UTC time.

Returns
  UTC time.

## ◆ IsValid()

bool foxit::DateTime::IsValid | ( |  | ) | const

Check whether current object is valid or not.

When the current object is not valid, that means current object is useless.

Returns
  true means current object is valid, while false means not.

## ◆ operator!=()

bool foxit::DateTime::operator!= | ( | const DateTime & | datetime | ) | const

Not equal operator.

Parameters

  [in] | datetime | Another date and time object. This function will check if current object is not equal to this one.

Returns
  true means not equal, while false means equal.

## ◆ operator<()

bool foxit::DateTime::operator< | ( | const DateTime & | datetime | ) | const

Smaller operator.

Parameters

  [in] | datetime | Another date and time object. This function will check if current object is smaller than this one.

Returns
  true means current object is smaller, while false means current object is not smaller.

## ◆ operator<=()

bool foxit::DateTime::operator<= | ( | const DateTime & | datetime | ) | const

Smaller or equal operator.

Smaller or equal operator.

Parameters

  [in] | datetime | Another date and time object. This function will check if current object is smaller than or equal to this one.

Returns
  true means current object is smaller than or equal to the input one, while false means current object is greater than the input one.

## ◆ operator=()

DateTime& foxit::DateTime::operator= | ( | const DateTime & | dt | ) |
| inline

Assign operator.

Parameters

  [in] | dt | Another date and time object, whose value would be assigned to current object.

Returns
  Reference to current object itself.

## ◆ operator==()

bool foxit::DateTime::operator== | ( | const DateTime & | datetime | ) | const

Equal operator.

Parameters

  [in] | datetime | Another date and time object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.

## ◆ operator>()

bool foxit::DateTime::operator> | ( | const DateTime & | datetime | ) | const

Greater operator.

Parameters

  [in] | datetime | Another date and time object. This function will check if current object is greater than this one.

Returns
  true means current object is greater, while false means current object is not greater.

## ◆ operator>=()

bool foxit::DateTime::operator>= | ( | const DateTime & | datetime | ) | const

Greater or equal operator.

Parameters

  [in] | datetime | Another date and time object. This function will check if current object is greater than or equal to this one.

Returns
  true means current object is greater than or equal to the input one, while false means current object is smaller than the input one.

## ◆ Set()

void foxit::DateTime::Set | ( | uint16 | year,
|  | uint16 | month,
|  | uint16 | day,
|  | uint16 | hour,
|  | uint16 | minute,
|  | uint16 | second,
|  | uint16 | milliseconds,
|  | int16 | utc_hour_offset,
|  | uint16 | utc_minute_offset
| ) |  |
| inline

Set value.

Parameters

  [in] | year | Year. It should be a four-digit number, such as 2014.
  [in] | month | Month. Valid range: from 1 to 12.
  [in] | day | Day of month. Valid range: from 1 to 31.
  [in] | hour | Hour. Valid range: from 0 to 23.
  [in] | minute | Minute. Valid range: from 0 to 59.
  [in] | second | Second. Valid range: from 0 to 60. 60 for leap second.
  [in] | milliseconds | Millisecond. Valid range: from 0 to 999. PDF standard does not support now, this can be omitted if it is not applicable.
  [in] | utc_hour_offset | Hour of time zone. Valid range: from -12 to 12. Positive value for the eastern time zone, and negative value for the western time zone.
  [in] | utc_minute_offset | Minute of time zone. Valid range: from 0 to 59.

Returns
  None.

## ◆ ToLocalTime()

DateTime& foxit::DateTime::ToLocalTime | ( |  | ) |

Convert current object to local time.

Returns
  Refernce to current object itself.

## ◆ ToUTCTime()

DateTime& foxit::DateTime::ToUTCTime | ( |  | ) |

Convert current object to UTC time.

Returns
  Refernce to current object itself.

## Member Data Documentation

## ◆ utc_hour_offset

int16 foxit::DateTime::utc_hour_offset

Hour of time zone. Valid range: from -12 to 12.

Positive value for the eastern time zone, and negative value for the western time zone.