PTDate
@interface PTDate : TRN_date
The Date class is a utility class used to simplify work with PDF date objects.
PDF defines a standard date format, which closely follows international standard ASN.1 (Abstract Syntax Notation One), A date is a string of the form (D:YYYYMMDDHHmmSSOHH'mm’); See PDF Reference Manual for details.
Date can be associated with a SDF/Cos date string using Date(Obj*) constructor or later using Date::Attach(Obj*) or Date::Update(Obj*) methods.
Date keeps a local date/time cache so it is necessary to call Date::Update() method if the changes to the Date should be saved in the attached Cos/SDF string.
-
Date default constructor.
Declaration
Objective-C
- (instancetype)init;
Swift
init!()
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithYear: (unsigned short)year month: (char)month day: (char)day hour: (char)hour minute: (char)minute second: (char)second;
Swift
init!(year: UInt16, month: Int8, day: Int8, hour: Int8, minute: Int8, second: Int8)
-
Indicates whether the Date is valid (non-null).
Note
If this method returns false the underlying SDF/Cos object is null and the Date object should be treated as null as well.
Declaration
Objective-C
- (BOOL)IsValid;
Swift
func isValid() -> Bool
Return Value
True if this is a valid (non-null) Date; otherwise false.
-
Sets the date object to the current date and time. The method also updates associated SDF object.
Declaration
Objective-C
- (void)SetCurrentTime;
Swift
func setCurrentTime()
-
Saves changes made to the Date object in the attached (or specified) SDF/Cos string.
Parameters
d
- an optional parameter indicating a SDF string that should be updated and attached to this Date. If parameter d is NULL or is omitted, update is performed on previously attached Cos/SDF date.
Return Value
true if the attached Cos/SDF string was successfully updated, false otherwise.
-
Declaration
Objective-C
- (unsigned short)GetYear;
Swift
func getYear() -> UInt16
Return Value
The year.
-
Undocumented
Declaration
Objective-C
- (unsigned char)GetMonth;
Swift
func getMonth() -> UInt8
-
Undocumented
Declaration
Objective-C
- (unsigned char)GetDay;
Swift
func getDay() -> UInt8
-
Undocumented
Declaration
Objective-C
- (unsigned char)GetHour;
Swift
func getHour() -> UInt8
-
Undocumented
Declaration
Objective-C
- (unsigned char)GetMinute;
Swift
func getMinute() -> UInt8
-
Undocumented
Declaration
Objective-C
- (unsigned char)GetSecond;
Swift
func getSecond() -> UInt8
-
Undocumented
Declaration
Objective-C
- (unsigned char)GetUT;
Swift
func getUT() -> UInt8
-
Undocumented
Declaration
Objective-C
- (unsigned char)GetUTHour;
Swift
func getUTHour() -> UInt8
-
Undocumented
Declaration
Objective-C
- (unsigned char)GetUTMin;
Swift
func getUTMin() -> UInt8