Initializerswift-png 4.4.5PNG
init(year:month:day:hour:minute:second:)
Creates an image modification time.
PNG.TimeModified.swift:56init(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int)
Parameters
- year
The complete gregorian year. It must be in the range
0 ..< 1 << 16
. It can be reasonably expected to have four decimal digits.- month
The calendar month, expressed as a 1-indexed integer. It must be in the range
1 ... 12
.- day
The calendar day, expressed as a 1-indexed integer. It must be in the range
1 ... 31
.- hour
The hour, in 24-hour time, expressed as a 0-indexed integer. It must be in the range
0 ... 23
.- minute
The minute, expressed as a 0-indexed integer. It must be in the range
0 ... 59
.- second
The second, expressed as a 0-indexed integer. It must be in the range
0 ... 60
, where the value60
is used to represent leap seconds.
The time is time-zone agnostic, and so all time parameters are assumed to be in universal time (UTC). Passing out-of-range time parameters will result in a precondition failure.
Other members in extension
Type members
init(parsing: [UInt8]
) throws Creates an image modification time by parsing the given chunk data.
Instance members
let day: Int
The calendar day, expressed as a 1-indexed integer.
var description: String
let hour: Int
The hour, in 24-hour time, expressed as a 0-indexed integer.
let minute: Int
The minute, expressed as a 0-indexed integer.
let month: Int
The calendar month, expressed as a 1-indexed integer.
let second: Int
The second, expressed as a 0-indexed integer.
var serialized: [UInt8]
Encodes this image modification time as the contents of a
tIME
chunk.let year: Int
The complete gregorian year.