ios - Timestamp (milliseconds) in Swift -
I am getting a creation date for an object in the database as milliseconds (in the era or by whatever value of milliseconds #) And would like to change it with a string in Swift!
I think I would need a data type of CUNSoundLang? I'm trying something like this, but it produces wrong number:
var test: CUnsignedLong = 1397016000000 println (test) // outputs 1151628800 instead!
I think this is the wrong data type, so what would you recommend to everyone in such a situation? I was working in Java that was working for a long time, which was working.
Thank you!
32-bit platform, CUnsignedLong
is a 32-bit integer, which is 1397016000000 is not enough to catch the number. (This is different from Java, where tall
is usually 64-bit integer.)
You can use UInt64
or NSTimeInterval
( You can use NSDate
methods, which can be used for double type
).
Comments
Post a Comment