I have a Ruby code that does not look like this.
str = 2010-12-02_12-10-26 puts str puts DateTime.parse(str, "%Y-%m-%d_%H-%M-%S")
I expected to get the actual time from parsing. Instead, I get the output as follows:
2010-12-02_12-10-26 2010-12-02T00:00:00+00:00
How to get the time in which you analyzed?
ruby datetime parsing
Drew
source share