I'm working with a Dataset which gives me a Time Variable for Objects, just like the created_at. The value tho is :

1398037671

Is this a special kind of encoding Timestamps or am i missing something ?

有帮助吗?

解决方案

I guess it is "seconds since the Epoch" timestamp

Time.at(1398037671) 2014-04-21 01:47:51 +0200

http://www.ruby-doc.org/core-2.1.1/Time.html#method-c-at

其他提示

That's a Unix timestamp. That specific timestamp represents 04 / 20 / 14 @ 11:47:51pm UTC

You can find out more about them here: http://www.unixtimestamp.com/index.php and at good old wikipedia here: http://en.wikipedia.org/wiki/Unix_time

In Ruby, you can generate a Unix timestamp with Time.now.to_i (or obviously any other time if you don't want the timestamp for now).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top