Forums

DateTimeZone error

Alistair 14 Jan, 2019
Hello, all of a sudden the form doesn't work and reports the following error:

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

Anyone has an idea on how to correct? Thanks.
healyhatman 14 Jan, 2019
You need to use a valid PHP timezone.
healyhatman 14 Jan, 2019
http://php.net/manual/en/timezones.php

The latest update fixed {date/timezone:}. Previously it would either do UTC or if you used /anything it would just use the site's timezone. Now you can do either {date:} for UTC, {date/site:} for your site's timezone, or {date/valid/PHPTimezone:} for a specific timezone, e.g. {date/Australia/Sydney:} but it has to be a valid timezone string or you'll get an error.
Alistair 14 Jan, 2019
Hi, I checked and I already the lastest version (V6.0.21), I then put a valid timezone in the Global Configuration (before it was UTC), cleared the cache and also changed browser but same error, where else should I put the valid timezone I don't understand.
healyhatman 14 Jan, 2019
What's the {date:} thing you're using
Alistair 14 Jan, 2019
Where do I have to look to find this "{date:} thing" you talk about?
healyhatman 14 Jan, 2019
Well obviously you've used {date:} somewhere on your form right? Maybe in a save data action or something? Or in the email?
Alistair 14 Jan, 2019
I put these two custom fields in the body of the email:
{date/time_zone:format_string}
{ip:}
healyhatman 14 Jan, 2019
So you literally put "{date/time_zone:format_string:}" in your email?

Because.... "time_zone" is not a valid timezone, and "format_string" is not a valid format string.
Alistair 14 Jan, 2019
That string was working quite well (I can show you received emails) up until the last time I checked, it basically tells me the time zone of the sender. Are you saying I can't use that string anymore? May I know what changed?
PS. I have now removed that string and it works fine.
healyhatman 14 Jan, 2019
I told you what changed, look at my second reply.
Alistair 14 Jan, 2019
Is there a way to find out again the time zone of the sender? (I can't put a valid time zone myself as I don't know where the sender is from)
healyhatman 14 Jan, 2019
The timezone string is something YOU can set, and happens server side, it never got the timezone of the sender.
Alistair 14 Jan, 2019
Thanks for your time and for clarifying this.
This topic is locked and no more replies can be posted.