Foxit PDF SDK
FSDateTime Class Reference

Inherits NSObject.

Instance Methods

(id) - init
 Constructor.

 
(id) - initWithDt:
 Constructor, with another date and time object.
More...
 
(id) - initWithYear:month:day:hour:minute:second:milliseconds:utc_hour_offset:utc_minute_offset:
 Constructor, with parameters.
More...
 
(BOOL) - isValid
 Check whether current object is valid or not.
More...
 
(void) - set:month:day:hour:minute:second:milliseconds:utc_hour_offset:utc_minute_offset:
 Set value.
More...
 
(FSDateTime *) - toLocalTime
 Convert current object to local time.
More...
 
(FSDateTime *) - toUTCTime
 Convert current object to UTC time.
More...
 

Class Methods

(FSDateTime *) + getLocalTime
 Get local time.
More...
 
(FSDateTime *) + getUTCTime
 Get UTC time.
More...
 

Properties

unsigned short day
 Day of month. Valid range: from 1 to 31.

 
unsigned short hour
 Hour. Valid range: from 0 to 23.

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

 
unsigned short minute
 Minute. Valid range: from 0 to 59.

 
unsigned short month
 Month. Valid range: from 1 to 12.

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

 
short utc_hour_offset
 Hour of time zone. Valid range: from -12 to 12.
More...
 
unsigned short utc_minute_offset
 Minute of time zone. Valid range: from 0 to 59.

 
unsigned short year
 Year. It should be a four-digit number, such as 2014.

 

Detailed Description

This class represents date, time and timezone.

Method Documentation

◆ getLocalTime()

+ (FSDateTime *) getLocalTime

Get local time.

Returns
Local time.

◆ getUTCTime()

+ (FSDateTime *) getUTCTime

Get UTC time.

Returns
UTC time.

◆ initWithDt:()

- (id) initWithDt: (FSDateTime*)  dt

Constructor, with another date and time object.

Parameters
[in]dtAnother date and time object.

◆ initWithYear:month:day:hour:minute:second:milliseconds:utc_hour_offset:utc_minute_offset:()

- (id) initWithYear: (unsigned short)  year
month: (unsigned short)  month
day: (unsigned short)  day
hour: (unsigned short)  hour
minute: (unsigned short)  minute
second: (unsigned short)  second
milliseconds: (unsigned short)  milliseconds
utc_hour_offset: (short)  utc_hour_offset
utc_minute_offset: (unsigned short)  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.

◆ isValid()

- (BOOL) isValid

Check whether current object is valid or not.

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

Returns
YES means current object is valid, while NO means not.

◆ set:month:day:hour:minute:second:milliseconds:utc_hour_offset:utc_minute_offset:()

- (void) set: (unsigned short)  year
month: (unsigned short)  month
day: (unsigned short)  day
hour: (unsigned short)  hour
minute: (unsigned short)  minute
second: (unsigned short)  second
milliseconds: (unsigned short)  milliseconds
utc_hour_offset: (short)  utc_hour_offset
utc_minute_offset: (unsigned short)  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.

◆ toLocalTime()

- (FSDateTime *) toLocalTime

Convert current object to local time.

Returns
Refernce to current object itself.

◆ toUTCTime()

- (FSDateTime *) toUTCTime

Convert current object to UTC time.

Returns
Refernce to current object itself.

Property Documentation

◆ utc_hour_offset

- (short) utc_hour_offset
readwritenonatomicassign

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.