ClockTime 1.2

ClockTime 1.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release May 2017
SwiftSwift Version 3.1
SPMSupports SPM

Maintained by Yuki Mishima.



  • By
  • Yuki Mishima

Simple clock model written in Swift.

Usage

Add seconds

ClockTime(hour: 23, minute: 59, second: 59)! + 1
// -> 0h 0m 0s

Subtract seconds

ClockTime(hour: 0, minute: 0, second: 0)! - 1
// -> 23h 59m 59s

Compare two clock times

ClockTime(hour: 0, minute: 0, second: 0)! == ClockTime(hour: 0, minute: 0, second: 0)!
// -> true
ClockTime(hour: 0, minute: 0, second: 1)! > ClockTime(hour: 0, minute: 0, second: 0)!
// -> true

Determine whether it is between two clock times

ClockTime(hour: 0, minute: 0, second: 0)!.
    isBetween(
        beginning: ClockTime(hour: 23, minute: 59, second: 59)!,
        end: ClockTime(hour: 0, minute: 0, second: 1)!
    )
// -> true

Requirements

Swift 3

Installation

pod "ClockTime"

License

ClockTime is available under the MIT license. See the LICENSE file for more info.