You can simply use NSDate’s timeIntervalSince1970
function.
let timeInterval = NSDate().timeIntervalSince1970
More Related Contents:
- Making a website like pingdom – how is it programmed? [closed]
- How can I parse / create a date time stamp formatted with fractional seconds UTC timezone (ISO 8601, RFC 3339) in Swift?
- How to format current time using a yyyyMMddHHmmss format?
- Measure elapsed time in Swift
- Parsing date/time strings which are not ‘standard’ formats
- Xcode Swift am/pm time to 24 hour format
- Will a docker container auto sync time with its host machine?
- Date to milliseconds and back to date in Swift
- Lua – Current time in milliseconds
- Swift convert unix time to date and time
- Comparing NSDates without time component
- Convert UTC to “local” time in Go
- How do I get the current time in Elm?
- Swift do-try-catch syntax
- How do I set bold and italic on UILabel of iPhone/iPad?
- Check whether the string is a unix timestamp
- Check password string strength criteria in Swift
- How do I declare a variable that has a type and implements a protocol?
- Convert a Date (absolute time) to be sent/received across the network as Data in Swift?
- fatal error: unexpectedly found nil while unwrapping an Optional value [duplicate]
- Can somebody give a snippet of “append if not exists” method in swift array?
- How to use NSLocalizedString function with variables in Swift?
- App Tracking Transparency Dialog does not appear on iOS
- Create Directory in Swift 3.0
- Twitter Call back URL
- print current date in java
- Swift find all occurrences of a substring
- Setting up UIScrollView to swipe between 3 view controllers
- How to use NSUnderlineStyle.PatternDot
- arc4random_uniform not available in Xcode 7.0 beta (7a176x) on OSX 10.10.4