https://github.com/0xleif/sec
String to seconds
https://github.com/0xleif/sec
seconds string swift time
Last synced: about 1 year ago
JSON representation
String to seconds
- Host: GitHub
- URL: https://github.com/0xleif/sec
- Owner: 0xLeif
- License: mit
- Created: 2021-05-03T16:55:13.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-08T16:20:29.000Z (about 5 years ago)
- Last Synced: 2025-02-10T23:41:45.487Z (over 1 year ago)
- Topics: seconds, string, swift, time
- Language: Swift
- Homepage: https://github.com/sindresorhus/sec
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sec
*String to seconds*
**(Swift version of [sec](https://github.com/sindresorhus/sec))**
## Example
```swift
XCTAssertEqual("00:00:05".toSeconds, 5)
XCTAssertEqual("00:01:00".toSeconds, 60)
XCTAssertEqual("01:01:01".toSeconds, 3661)
XCTAssertEqual("01:00".toSeconds, 60)
XCTAssertEqual("01".toSeconds, 1)
XCTAssertEqual("1".toSeconds, 1)
```