PDFDateFormatter
public final class PDFDateFormatter : FormatterThe PDFDateFormatter class generates and parses string representations of dates
that are used as the PDF metadata. For example, when setting a creation date of a document, the Date
value is converted to String using this formatter.
Example:
Assume we have 2017, March 27, 18:32:30 in the YEKT time zone (UTC/GMT +5 hours).
PDFDateFormatter will transform this date as D:20170327183230+05'00’
 and vice versa.
- 
                  
                  Creates an instance of the formatter. DeclarationSwift public override init()
- 
                  
                  Creates an instance of the formatter using the provided unarchiver. This is not required for PDFDateFormatterand is kept only for satisfying theFormatterabstract class requirements.DeclarationSwift public required init?(coder aDecoder: NSCoder)
- 
                  
                  Converts the given value of type Dateto a string representation using theTimeZone.currenttime zone.DeclarationSwift public override func string(for obj: Any?) -> String?ParametersobjThe date to convert to a string. Return ValueThe string representation of the given date, or nilifobjis not a date.
- 
                  
                  Converts the given dateto a string with respect to the providedtimeZone.DeclarationSwift public func string(from date: Date, timeZone: TimeZone = .current) -> StringParametersdateThe date to convert to a string. timeZoneThe time zone to encode in the resulting string. Default value is TimeZone.current.Return ValueThe string representation of the given date. 
- 
                  
                  Decodes the given stringinto the date it represents.DeclarationSwift public func date(from string: String) -> Date?ParametersstringThe string representation of a date in the standard PDF date format (e. g. D:20170327183230+05'00’ )Return ValueThe Datevalue thatstringrepresents, ornilifstringis invalid.
 View on GitHub
View on GitHub PDFDateFormatter Class Reference
        PDFDateFormatter Class Reference