# |
May 31st 2016, 09:11 |
birdy247 |
I used to do this is the entity |
# |
May 31st 2016, 09:10 |
Neon1024 |
So your app doesnâ??t break in Oct |
# |
May 31st 2016, 09:10 |
Neon1024 |
So now you need to think about daylight savings time too |
# |
May 31st 2016, 09:10 |
birdy247 |
this is all I am trying to do |
# |
May 31st 2016, 09:10 |
Neon1024 |
Yep |
# |
May 31st 2016, 09:10 |
birdy247 |
but its says 10am UTC |
# |
May 31st 2016, 09:10 |
birdy247 |
yea, but if a user selects 10am, thats 10am our time so 9am UTC |
# |
May 31st 2016, 09:09 |
Neon1024 |
As it should be, UTC |
# |
May 31st 2016, 09:09 |
birdy247 |
but its the wrong timezone |
# |
May 31st 2016, 09:09 |
birdy247 |
its fine |
# |
May 31st 2016, 09:09 |
birdy247 |
If I let cake do it |
# |
May 31st 2016, 09:09 |
Neon1024 |
Sounds like youâ??re not letting things work for you |
# |
May 31st 2016, 09:08 |
birdy247 |
I literally lose the will to live with datetimes :( |
# |
May 31st 2016, 09:08 |
Neon1024 |
So I just let CakePHP infer the type from the data |
# |
May 31st 2016, 09:08 |
Neon1024 |
echo $this->Form->input('closes'); |
# |
May 31st 2016, 09:08 |
Neon1024 |
echo $this->Form->input('opens'); |
# |
May 31st 2016, 09:08 |
Neon1024 |
date_default_timezone_set('Europe/London'); |
# |
May 31st 2016, 09:07 |
Neon1024 |
But let me double check in the repo |
# |
May 31st 2016, 09:07 |
birdy247 |
so its a series of dropdowns? |
# |
May 31st 2016, 09:07 |
Neon1024 |
Form->input(â??fooâ??, [â??typeâ?? => â??datetimeâ??]) |
# |
May 31st 2016, 09:07 |
birdy247 |
picker* |
# |
May 31st 2016, 09:07 |
birdy247 |
my use case is a datetime picket |
# |
May 31st 2016, 09:07 |
birdy247 |
but on the front end |
# |
May 31st 2016, 09:06 |
Neon1024 |
Standard MySQL datetime |
# |
May 31st 2016, 09:06 |
Neon1024 |
My datetimes are Y-m-d H:i:s in my database |
# |
May 31st 2016, 09:06 |
birdy247 |
what is the format of the string you are converting? |
# |
May 31st 2016, 09:06 |
birdy247 |
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_GB'), |
# |
May 31st 2016, 09:05 |
Neon1024 |
Time to fire up XDebug ;) |
# |
May 31st 2016, 09:05 |
Neon1024 |
¯\_(ã??)_/¯ |
# |
May 31st 2016, 09:05 |
birdy247 |
gives null |
# |
May 31st 2016, 09:05 |
birdy247 |
$value = parent::_parseValue($value); |
# |
May 31st 2016, 09:05 |
Neon1024 |
ini_set('intl.default_locale', 'en_GB'); |
# |
May 31st 2016, 09:05 |
Neon1024 |
Isnâ??t your applications default locale en_GB ? |
# |
May 31st 2016, 09:04 |
birdy247 |
on the frontend |
# |
May 31st 2016, 09:04 |
birdy247 |
yea, put the string is d-m-Y |
# |
May 31st 2016, 09:04 |
Neon1024 |
Storage and display are different ;) |
# |
May 31st 2016, 09:04 |
Neon1024 |
Y-m-d |
# |
May 31st 2016, 09:04 |
birdy247 |
it needs to be d/m/Y presumably |
# |
May 31st 2016, 09:04 |
unorthodox |
Or am i too paranoid about. Shall i modify data before patchingentity |
# |
May 31st 2016, 09:04 |
Neon1024 |
Y U DO DIS |
# |
May 31st 2016, 09:04 |
Neon1024 |
In your db? |