com.foxit.sdk.common.DateTime Class Reference

Public Member Functions

 DateTime (int year, int month, int day, int hour, int minute, int second, int milliseconds, short utc_hour_offset, int utc_minute_offset)
 Constructor, with parameters.
More...
 
 DateTime ()
 Constructor.

 
 DateTime (DateTime dt)
 Constructor, with another date and time object.
More...
 
int getDay ()
 Get day of month. More...
 
int getHour ()
 Get hour. More...
 
int getMilliseconds ()
 Get millisecond. More...
 
int getMinute ()
 Get minute. More...
 
int getMonth ()
 Get month. More...
 
int getSecond ()
 Get second. More...
 
short getUtc_hour_offset ()
 Get hour of time zone. More...
 
int getUtc_minute_offset ()
 Get minute of time zone. More...
 
int getYear ()
 Get year. More...
 
boolean isValid ()
 Check whether current object is valid or not.
More...
 
void set (int year, int month, int day, int hour, int minute, int second, int milliseconds, short utc_hour_offset, int utc_minute_offset)
 Set value.
More...
 
void setDay (int value)
 Set day of month. More...
 
void setHour (int value)
 Set hour. More...
 
void setMilliseconds (int value)
 Set millisecond. More...
 
void setMinute (int value)
 Set minute. More...
 
void setMonth (int value)
 Set month. More...
 
void setSecond (int value)
 Set second. More...
 
void setUtc_hour_offset (short value)
 Set hour of time zone. More...
 
void setUtc_minute_offset (int value)
 Set minute of time zone. More...
 
void setYear (int value)
 Set year. 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]

com.foxit.sdk.common.DateTime.DateTime ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second,
int  milliseconds,
short  utc_hour_offset,
int  utc_minute_offset 
)

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.

◆ DateTime() [2/2]

com.foxit.sdk.common.DateTime.DateTime ( DateTime  dt)

Constructor, with another date and time object.

Parameters
[in]dtAnother date and time object.

Member Function Documentation

◆ getDay()

com.foxit.sdk.common.DateTime.getDay ( )

Get day of month.

Returns
Day of month. Valid range: from 1 to 31.

◆ getHour()

com.foxit.sdk.common.DateTime.getHour ( )

Get hour.

Returns
Hour. Valid range: from 0 to 23.

◆ getLocalTime()

static DateTime com.foxit.sdk.common.DateTime.getLocalTime ( )
static

Get local time.

Returns
Local time.

◆ getMilliseconds()

com.foxit.sdk.common.DateTime.getMilliseconds ( )

Get millisecond.

Returns
Millisecond. Valid range: from 0 to 999. PDF standard does not support now, this can be omitted if it is not applicable.

◆ getMinute()

com.foxit.sdk.common.DateTime.getMinute ( )

Get minute.

Returns
Minute. Valid range: from 0 to 59.

◆ getMonth()

com.foxit.sdk.common.DateTime.getMonth ( )

Get month.

Returns
Month. Valid range: from 1 to 12.

◆ getSecond()

com.foxit.sdk.common.DateTime.getSecond ( )

Get second.

Returns
Second. Valid range: from 0 to 60. 60 for leap second.

◆ getUtc_hour_offset()

com.foxit.sdk.common.DateTime.getUtc_hour_offset ( )

Get hour of time zone.

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

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

◆ getUtc_minute_offset()

com.foxit.sdk.common.DateTime.getUtc_minute_offset ( )

Get minute of time zone.

Returns
Minute of time zone. Valid range: from 0 to 59.

◆ getUTCTime()

static DateTime com.foxit.sdk.common.DateTime.getUTCTime ( )
static

Get UTC time.

Returns
UTC time.

◆ getYear()

com.foxit.sdk.common.DateTime.getYear ( )

Get year.

Returns
Year. It should be a four-digit number, such as 2014.

◆ isValid()

boolean com.foxit.sdk.common.DateTime.isValid ( )

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 com.foxit.sdk.common.DateTime.set ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second,
int  milliseconds,
short  utc_hour_offset,
int  utc_minute_offset 
)

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.

◆ setDay()

com.foxit.sdk.common.DateTime.setDay ( int  value)

Set day of month.

Parameters
[in]valueDay of month. Valid range: from 1 to 31.
Returns
None.

◆ setHour()

com.foxit.sdk.common.DateTime.setHour ( int  value)

Set hour.

Parameters
[in]valueHour. Valid range: from 0 to 23.
Returns
None.

◆ setMilliseconds()

com.foxit.sdk.common.DateTime.setMilliseconds ( int  value)

Set millisecond.

Parameters
[in]valueMillisecond. Valid range: from 0 to 999. PDF standard does not support now, this can be omitted if it is not applicable.
Returns
None.

◆ setMinute()

com.foxit.sdk.common.DateTime.setMinute ( int  value)

Set minute.

Parameters
[in]valueMinute. Valid range: from 0 to 59.
Returns
None.

◆ setMonth()

com.foxit.sdk.common.DateTime.setMonth ( int  value)

Set month.

Parameters
[in]valueMonth. Valid range: from 1 to 12.
Returns
None.

◆ setSecond()

com.foxit.sdk.common.DateTime.setSecond ( int  value)

Set second.

Parameters
[in]valueSecond. Valid range: from 0 to 60. 60 for leap second.
Returns
None.

◆ setUtc_hour_offset()

com.foxit.sdk.common.DateTime.setUtc_hour_offset ( short  value)

Set hour of time zone.

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

Parameters
[in]valueHour of time zone. Valid range: from -12 to 12.
Returns
None.

◆ setUtc_minute_offset()

com.foxit.sdk.common.DateTime.setUtc_minute_offset ( int  value)

Set minute of time zone.

Parameters
[in]valueMinute of time zone. Valid range: from 0 to 59.
Returns
None.

◆ setYear()

com.foxit.sdk.common.DateTime.setYear ( int  value)

Set year.

Parameters
[in]valueYear. It should be a four-digit number, such as 2014.
Returns
None.

◆ toLocalTime()

DateTime com.foxit.sdk.common.DateTime.toLocalTime ( )

Convert current object to local time.

Returns
Refernce to current object itself.

◆ toUTCTime()

DateTime com.foxit.sdk.common.DateTime.toUTCTime ( )

Convert current object to UTC time.

Returns
Refernce to current object itself.