CodeIgniter stores timezones for its date class in
system/language/english/date_lang.php
I would like to change the strings in this file so that
$lang['UM12'] = '(UTC -12:00) Baker/Howland Island';
$lang['UM11'] = '(UTC -11:00) Samoa Time Zone, Niue';
would instead be
$lang['-12:00'] = '(UTC -12:00) Baker/Howland Island';
$lang['-11:00'] = '(UTC -11:00) Samoa Time Zone, Niue';
Is this possible at all?
Any change I make to the UM__ portion of one line makes it show as a blank on the dropdown. The remaining (unchanged) lines appear OK.
I have also tried to clone this file to application/language/english/ with similar bad results.
Any insights on this?
It looks like this would require hacks to the
date_helper.phpfile which I am not willing to do.Instead, the date class in CI has the
timezones()function which allows you to convert from, for example,UM5to-5. In that case one can wrap this function around theU__value coming from the view/dropdown — and then save it to DB as-5or some otherINT.Since I want to show the user their selected timezone on that same dropdown, I am forced to have DB fields for the
U__andINTtimezone formats. As far as I know, there is no CI function to convert from-5toUM5.So, for the user, I pull the
U__format into the view to autopopulate the dropdown.For timezone conversions and such, I use the
INTformat.