DateTimeZone::__construct(): Unknown or bad timezone (timezone)

peppelaria 15 Jan, 2019
Hi Bob.

I'm having the following problem: "DateTimeZone::__construct(): Unknown or bad timezone (timezone)" on every db save action.
in the db save action I use "modified:{date/timezone:Y-m-d H:i:s}" to have the correct timezone saved in the db.
can you help me about this?

thanks in advance
healyhatman 15 Jan, 2019
You need to replace "timezone" with an actual valid timezone.
healyhatman 15 Jan, 2019
https://www.chronoengine.com/forums/posts/t106584/datetimezone-error

Also, you could leave it as {date:} and DISPLAY it as the correct timezone.
peppelaria 15 Jan, 2019
Answer
thanks Healyhatman, i solved creating a php variable
"putenv("TZ=Europe/Rome");
return date("Y-m-d H:i:s");"
and passing it to dbsave action: "nodified:{var:now}".

It's been too much work because I had to modify a great amount of forms
healyhatman 15 Jan, 2019
Why? Just do it as
modified:{date/Europe/Rome:Y-m-d H:i:s}

OR if you just want it according to the server timezone set in your php.ini, use
modified:{date/site:}
This topic is locked and no more replies can be posted.