Date Field in Report off by 1 day

I have a Date of Joining field in Employee module. When I run a report and create a scheduler to run it at the end of month, the Date of joining in report is off by 1 day. In the employee module the date is correct. I see a similar issue in the post below and followed the fix (aor_utils and aow_utils file) but it did not help. Anyone else having similar issues and have you been able to fix?

Using SuiteCRM 7.10.11
Date Format is set to %c

So you are using the version that the linked fix is included in or did you manually update those files?

What is your timezone may I ask. Is the Date of Joining field a custom Date (not DateTime) field?
Is the Date correct in the database for that particular field?

I applied the fix manually. I am in the EST timezone. Date of Joining is a custom Date field. (not DateTime). Date is correct in the database.

When you run the Reports from the scheduler the date.timezone that applies is the one from the CLI PHP, which is different (uses a different php.ini) than the web-server PHP.

Try this from the command-line to check:

php -i | grep timezone

and if you need to edit it, this should give you the correct path:

php -i | grep php.ini

I had already make the change of timezone through CLI to America/New_York. Verified it in the PHP.ini. Rebooted the server again just in case but still the Date of Joining field in report is off by 1 day. The date of joining field is correct in DB and the module edit and detail view.

php -i | grep timezone will tell you your effective timezone in CLI

Admin / Diagnostics / phpinfo will tell you your effective timezone in web server.

Please check both, because sometimes there are other settings taking effect, and what you think is already set in php.ini might not be the actual value.

If that isn’t the problem, then I suggest re-creating the Report. That fix you applied might correct a problem when creating and saving the Report, not when displaying it, so maybe if your Report was already done before applying the fix, that isn’t enough…

Tell me if that works for you

Date in Admin / Diagnostics/PHPinfo is America/New York. see below.

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

Recreated the report but still seeing the same issue. The date is off by 1 day.

I’m on 7.10.10 and am also experiencing this issue with a Date field. It’s right in the DB but 1 day off in the report. The fix on github did not work.

I did some playing around. If you add a date format options to the report ie: dd/mm/yyyy it works, but if you leave the date format in the report as --none-- it’s off by one day.

4 Likes

Can you find the place in the code where that format is getting applied?

I had the same issue with Version 8.2.3 and your post help me solve it. Thank you!

1 Like