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 DateTime. 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...
 

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

◆ DateTime() [2/2]

foxit.common.DateTime.DateTime ( DateTime  dt)
inline

Constructor, with another DateTime.

Parameters
dtAnother DateTime object.

Member Function Documentation

◆ GetLocalTime()

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

Get local time.

Returns
Local time.

◆ GetUTCTime()

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

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
yearYear. It should be a four-digit number, such as 2014.
monthMonth. Valid range: from 1 to 12.
dayDay of month. Valid range: from 1 to 31.
hourHour. Valid range: from 0 to 23.
minuteMinute. Valid range: from 0 to 59.
secondSecond. Valid range: from 0 to 60. 60 for leap second.
millisecondsMillisecond. Valid range: from 0 to 999. PDF standard does not support now, this can be omitted if it is not applicable.
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.
utc_minute_offsetMinute 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.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.