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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -