sjelfull / craft-audit

Audit log for Craft 3
https://superbig.co
Other
20 stars 11 forks source link

Logs appear to be saved and displayed in UTC+0 #66

Closed simple-nicholas closed 2 years ago

simple-nicholas commented 3 years ago

I'm working on a site configured to use the GMT+10 (Australia/Melbourne) timezone & the control panel language is en-GB.

The Audit logs appear to be correct otherwise, but they seem to be logged to the DB with a "createdDate" that's 10 hours early.

I tested the rest of the site, and can't find any other issues (like entries being created or saved with the wrong "createdDate").

The issue persists regardless of the user, web browser, even server environment (tried cloning the site to a staging environment & local dev).

mildlygeeky commented 2 years ago

Came here to add this as well - everywhere else in Craft lists the user's local time, which makes the audit log pretty confusing.

sjelfull commented 2 years ago

Hey, i've found the bug. The date is saved correctly as UTC, but when displayed it doesn't restore it from UTC to a localized date/time.

mildlygeeky commented 2 years ago

Thanks for the find @sjelfull! Curious - do you think this plugin will make the move over to Craft 4 at some point?

sjelfull commented 2 years ago

@mildlygeeky Yep! Working on it right now, just need some time in-between to get it released. Will have this fix as well. (I realise its been a while) Do you need this fix backported to a version supporting 3.x or are you fine with it being Craft 4 version only?

mildlygeeky commented 2 years ago

I'm in full support of leaving the old version behind! :)

sjelfull commented 2 years ago

3.0.0 is out with this fix now :)