TIMEX TIMEX - 7 months ago 73
iOS Question

In Swift, how can I get the UNIX Epoc timestamp, in milliseconds?

UInt64(NSDate().timeIntervalSince1970)


This only gets the timestamp in seconds, but not milliseconds.

Answer

Multiply by 1000.

UInt64(NSDate().timeIntervalSince1970 * 1000.0)