New case workflow notification time shows wrong time

When I create a case, I have a workflow notification that shows the scheduled date and time in the email that it sends to the assigned user. It shows a wrong time in the email.

Example: Create a new case, set time to 4:30pm.

A custom workflow sends and email notification that contains that date and time tag in it.

The email shows date and time like this instead 2018-05-09 20:30:00

It’s wrong format, and wrong time.

What could be wrong in the system?

Hi
Can you please try to match your’s and admin user timezone from users profile advanced tab?
Thanks

I am the admin, and the time zone in my profile advanced tab is America/New York - 4:00. Also the date format is 12/23/2010. The email shows a different format and completely wrong time.

Any ideas?

Update:

It looks like it shows wrong time when the workflow is triggered on save. However, when the same email is triggered by the scheduler, it shows correct format and correct time.

Why is that?

You need to check date.timezone in both your php.ini’s:

  • the php.ini used by CLI (command-line, includes everything launched from cron.php including Scheduled workflows). You can find out the path by running this from the command-line:
php -i | grep php.ini
  • the php.ini used by the web server (impacts the rest of SuiteCRM)

You can find out the path by going into Admin / Diagnostics and choosing phpinfo.

My /etc/php.ini contains this ;date.timezone =

What should I put after =?

Also where is the other php.ini located? The command only showed this file.

Thanks a lot!

I entered it like this date.timezone=“America/New_York”

However, when I create a new task, I still get this time format 2018-05-03 14:00:00 (Actual date and time entered was 05/03/2018 10:00am)

What do you think I’m missing?

I found two php.ini files in my installation

/etc/php.ini and /var/www/html/build/php.ini

Changed time zones on both of them to date.timezone=“America/New_York”

And still receiving an email from workflow in UTC format. I even changed the Centos local time to America/New_York as well.

Where else would I have to look?

My post above told you exactly where to get the precise location of the php.ini’s that count. In Admin / Diagnostics /phpinfo you can also check whether the values you specified took effect.

Don’t forget to restart Apache after each of these changes.

Check your logs for errors regarding timezones.

Yeah even the php info is showing the correct time zone.

My cases, tasks etc are still showing UTC format in the workflow email on save.

  1. I hope you got that phpinfo from Admin / Diagnostics, not from somewhere else.

  2. What does this give you?

php -i | grep timezone
  1. And your logs?

  2. In Admin / Schedulers, going inside an individual job, do the times seem correct? Do jobs that run frequently appear to have ran sucessfully recently?

  3. In the Workflow, or in the email template, how do you specify the date variable?

Please go through all these points one by one. Thanks

Yep the admin diagnostics is giving me this:

date/time support enabled
“Olson” Timezone Database Version 0.system
Timezone Database internal
Default timezone America/New_York

The command you gave me shows this:

Default timezone => America/New_York
date.timezone => America/New_York => America/New_York

When I go in the scheduler, all times are shown correctly in the job log. Also, whatever is run by the schedule shows the correct time in the workflow email using same exact date variable - $task_date_start or for cases it’s $acase_ticket_date_start_c. Both of these variables show correctly if run by the scheduler. Only showing wrong when run on save.

And when I create a new task and a new case and check the suitecrm.log it only gives me one error with tasks - [7080][1][FATAL] could not load RHS in Task.

By the way thanks a lot for walking me through these troubleshooting steps. I appreciate it!

This is starting to look like a bug we can report on Github. Have you searched there for similar issues?

BTW, what is your version of SuiteCRM?

Mine is 7.10.4. I usually try to keep my CRM up to date.

I opened a new issue here:

https://github.com/salesagility/SuiteCRM/issues/5814

For reference:

https://github.com/salesagility/SuiteCRM/issues/5814

Sorry i thought i replied here. It’s actually my post. I just opened it today on GitHub.

My bad, I didn’t see your post here before! :slight_smile:

When is this issue going to get addressed?

https://github.com/salesagility/SuiteCRM/issues/5814