A Time module for Swift that wraps tm
in C
var t = Time()
print(t) // => %A, %B %d %Y %X formated datetime string
t.addDay(1)
t.format("%a, %d %b %Y %H:%M:%S %z")
init(tz: TimeZone = .Local, unixtime: Int? = nil)
public enum TimeZone {
case UTC
case Local
}
- rfc822
- rfc1123
- unixtime
- week
- year
- month
- yday
- day
- hour
- min
- sec
- addDay(x: Int) -> Time
- addHour(x: Int) -> Time
- addMin(x: Int) -> Time
- addSec(x: Int) -> Time
- format(format: String) -> String
- format: The Format string set for
strftime
in c lang
- format: The Format string set for
import PackageDescription
let package = Package(
name: "MyApp",
dependencies: [
.Package(url: "https://github.com/slimane-swift/Time", majorVersion: 0, minor: 1)
]
)
Time is released under the MIT license. See LICENSE for details.