0

I need to parse a file, first column contains this as I suggest it is timestamp. But I do not know encoding, so I decided to ask here maybe it's common encoding.

I have timestamps:

  1. 201003568295
  2. 960000188940

How can I get Date and Time or only Date from this?

zolter
  • 7,070
  • 3
  • 37
  • 51
  • I think no, it is different format, not unix – zolter Oct 04 '15 at 04:54
  • 1
    Where did these numbers come from? Do you know what dates and times the correspond to at least? – mu is too short Oct 04 '15 at 05:04
  • I need to parse a file, first column contains this as I suggest it is timestamp. But I do not know encoding, so I decided to ask here maybe it's common encoding. – zolter Oct 04 '15 at 05:14
  • It's not useful to repeat your question in the comments. Instead, explain your needs and why you think it is a date, in your question by editing it and add that information in at the appropriate places. The value is not a standard time in seconds as it's an extremely large range, and it doesn't make sense that the two would be related times. We need more context. What TYPE of file is it, what does it contain or what is its source? – the Tin Man Oct 04 '15 at 12:25

1 Answers1

2

You can refer here.

require 'date'
new_date = Time.at(960000188940).to_datetime
 #=> Wed, 13 Mar 32391 12:39:00 +053
Community
  • 1
  • 1
Amit Badheka
  • 2,677
  • 4
  • 19
  • 29