Ruby Datetime parse
I am trying to compare strings by date. First, I store the data with the date string like this:
to my PostgreSQL database.
I can see that my date was saved and now looks like this:
and the locale is set to
lc_collate = en_US.UTF-8
Now I am using the same file and I want to compare the date field to see if it is equal (and it should be!), But Ruby reads
0002-10-15 13:01:00 +0800
I tried to do this too:
But the result was
How can I get Ruby to read my input line the same way as my DB? I tried to install
config.i18n.default_locale = 'en-US'
.rb in my application but it didn't help.
source to share