TimeDate

public struct TimeDate : CustomStringConvertible

Immutable time and date.

  • Errors.

    See more

    Declaration

    Swift

    public enum Errors : Error
  • Year since 0.

    Declaration

    Swift

    public let year: Int
  • Month since January - [0,11].

    Declaration

    Swift

    public let month: Int
  • day

    Day of the month - [1,31].

    Declaration

    Swift

    public let day: Int
  • Hour since midnight - [0,23].

    Declaration

    Swift

    public let hour: Int
  • Minute after the hour - [0,59].

    Declaration

    Swift

    public let minute: Int
  • Second after the minute - [0,59].

    Declaration

    Swift

    public let second: Int
  • Create time and date with current time.

    Declaration

    Swift

    public init() throws
  • Create time and date.

    Declaration

    Swift

    public init(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int)
  • Create time and date from NSDate.

    Declaration

    Swift

    public init(date: Date) throws
  • Parse format string.

    Declaration

    Swift

    public init(format: String, text: String) throws
  • Convert to Date.

    Declaration

    Swift

    public func toDate() throws -> Date
  • Format date-time as string.

    Declaration

    Swift

    public func format(format: String) throws -> String
  • Format as day-month-year hour:minute:second string.

    Declaration

    Swift

    public func toStringRegular() throws -> String
  • Format as day.mount.year string for receipts.

    Declaration

    Swift

    public func toStringReceiptDate() throws -> String
  • Format as hour:minute:second string for receipts.

    Declaration

    Swift

    public func toStringReceiptTime() throws -> String
  • Textual representation.

    Declaration

    Swift

    public var description: String { get }