An open API service indexing awesome lists of open source software.

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

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)
```