TimeFormat
public enum TimeFormat
TimeFormat is an enum for formatting timestamps.
Given an hour, minute, and second, the time will be formatted in one of four formats.
hourMinuteMilitary
(e.g.19:41
)hourMinutePeriod
(e.g.07:41 PM
)hourMinuteSecondMilitary
(e.g.19:41:30
)hourMinuteSecondPeriod
(e.g.07:41:30 PM
)
-
Military time with hours and minutes (e.g.
19:41
)Declaration
Swift
case hourMinuteMilitary
-
Standard time with hours and minutes (e.g.
07:41 PM
)Declaration
Swift
case hourMinutePeriod
-
Military time with hours, minutes, and seconds (e.g.
19:41:30
)Declaration
Swift
case hourMinuteSecondMilitary
-
Standard time with hours, minutes, and seconds (e.g.
07:41:30 PM
)Declaration
Swift
case hourMinuteSecondPeriod
-
Convert the hour, minute, and second to the specified format.
Declaration
Swift
public func stringify(hour: Int, minute: Int, second: Int) -> String
Parameters
hour
The hour.
minute
The minute.
second
The second.
Return Value
The formatted string