Foxit PDF SDK

Public Member Functions | Static Public Member Functions | Properties | List of all members
foxit.common.DateTime Class Reference

Inherits SystemIDisposable.

## Public Member Functions
| DateTime (ushort year, ushort month, ushort day, ushort hour, ushort minute, ushort second, ushort milliseconds, short utc_hour_offset, ushort utc_minute_offset)
| Constructor, with parameters. More...
| DateTime ()
| Constructor.
| DateTime (DateTime dt)
| Constructor, with another date and time object. More...
bool | IsValid ()
| Check whether current object is valid or not. More...
void | Set (ushort year, ushort month, ushort day, ushort hour, ushort minute, ushort second, ushort milliseconds, short utc_hour_offset, ushort 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...

## Properties
ushort | day`[get, set]`
| Day of month. Valid range: from 1 to 31.
ushort | hour`[get, set]`
| Hour. Valid range: from 0 to 23.
ushort | milliseconds`[get, set]`
| Millisecond. Valid range: from 0 to 999. PDF standard does not support now, this can be omitted if it is not applicable.
ushort | minute`[get, set]`
| Minute. Valid range: from 0 to 59.
ushort | month`[get, set]`
| Month. Valid range: from 1 to 12.
ushort | second`[get, set]`
| Second. Valid range: from 0 to 60. 60 for leap second.
short | utc_hour_offset`[get, set]`
| Hour of time zone. Valid range: from -12 to 12. More...
ushort | utc_minute_offset`[get, set]`
| Minute of time zone. Valid range: from 0 to 59.
ushort | year`[get, set]`
| 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/2]

foxit.common.DateTime.DateTime | ( | ushort | year,
|  | ushort | month,
|  | ushort | day,
|  | ushort | hour,
|  | ushort | minute,
|  | ushort | second,
|  | ushort | milliseconds,
|  | short | utc_hour_offset,
|  | ushort | 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/2]

foxit.common.DateTime.DateTime | ( | 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.common.DateTime.GetLocalTime | ( |  | ) |
| inline static

Get local time.

Returns
  Local time.

## ◆ GetUTCTime()

static DateTime foxit.common.DateTime.GetUTCTime | ( |  | ) |
| inline static

Get UTC time.

Returns
  UTC time.

## ◆ IsValid()

bool foxit.common.DateTime.IsValid | ( |  | ) |
| inline

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.

## ◆ Set()

void foxit.common.DateTime.Set | ( | ushort | year,
|  | ushort | month,
|  | ushort | day,
|  | ushort | hour,
|  | ushort | minute,
|  | ushort | second,
|  | ushort | milliseconds,
|  | short | utc_hour_offset,
|  | ushort | 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.common.DateTime.ToLocalTime | ( |  | ) |
| inline

Convert current object to local time.

Returns
  Refernce to current object itself.

## ◆ ToUTCTime()

DateTime foxit.common.DateTime.ToUTCTime | ( |  | ) |
| inline

Convert current object to UTC time.

Returns
  Refernce to current object itself.

## Property Documentation

## ◆ utc_hour_offset

short foxit.common.DateTime.utc_hour_offset
| get set

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.