Foxit PDF SDK
 All Classes Namespaces Functions Enumerations Enumerator Properties Pages
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

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]yearYear. It should be a four-digit number, such as 2014.
[in]monthMonth. Valid range: from 1 to 12.
[in]dayDay of month. Valid range: from 1 to 31.
[in]hourHour. Valid range: from 0 to 23.
[in]minuteMinute. Valid range: from 0 to 59.
[in]secondSecond. Valid range: from 0 to 60. 60 for leap second.
[in]millisecondsMillisecond. Valid range: from 0 to 999. PDF standard does not support now, this can be omitted if it is not applicable.
[in]utc_hour_offsetHour 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_offsetMinute of time zone. Valid range: from 0 to 59.
foxit.common.DateTime.DateTime ( DateTime  dt)
inline

Constructor, with another date and time object.

Parameters
[in]dtAnother date and time object.

Member Function Documentation

static DateTime foxit.common.DateTime.GetLocalTime ( )
inlinestatic

Get local time.

Returns
Local time.
static DateTime foxit.common.DateTime.GetUTCTime ( )
inlinestatic

Get UTC time.

Returns
UTC time.
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.
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]yearYear. It should be a four-digit number, such as 2014.
[in]monthMonth. Valid range: from 1 to 12.
[in]dayDay of month. Valid range: from 1 to 31.
[in]hourHour. Valid range: from 0 to 23.
[in]minuteMinute. Valid range: from 0 to 59.
[in]secondSecond. Valid range: from 0 to 60. 60 for leap second.
[in]millisecondsMillisecond. Valid range: from 0 to 999. PDF standard does not support now, this can be omitted if it is not applicable.
[in]utc_hour_offsetHour 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_offsetMinute of time zone. Valid range: from 0 to 59.
Returns
None.
DateTime foxit.common.DateTime.ToLocalTime ( )
inline

Convert current object to local time.

Returns
Refernce to current object itself.
DateTime foxit.common.DateTime.ToUTCTime ( )
inline

Convert current object to UTC time.

Returns
Refernce to current object itself.

Property Documentation

short foxit.common.DateTime.utc_hour_offset
getset

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.