I’m having problem at the moment trying to parse a date. I’m reading in
2 dates from the view and want to search a DB for records between the 2
The 2 dates I read are in the format ‘%d.%m.%Y’, e.g. 22.04.2009
The dates in the DB are stored as VARCHAR in the format ‘%Y/%m/%d
I’ve set the default date in environments.db as follows:
:default => ‘%d.%m.%Y’
I’ve tried parsing the 2 dates as follows:
However the result is incorrect for my locale.
If I read in a date ‘12.04.2009’ I would get the following output:
2009/12/04, when what I want is 2009/04/12. It’s getting the day and
month mixed. The Locale on my machine is correct and the timezone in the
environments.db is set to UTC.