Unexpected behavior for "No time zone conversion" option

Created on 6 December 2010, almost 14 years ago
Updated 15 April 2023, over 1 year ago

When creating a datestamp field with the "No time zone conversion" option flagged I discovered a strange behavior. When you create a datestamp field with this setting flagged I would expect that no time zone manipulation would occur. However, it seems that if a users time zone is set then this takes precedence over the sites time zone setting. This appears to be happening because if $field['settings']['tz_handling'] is set to 'none' then it calls date_now() within date_now() a new DateObject is created and within the DateObject constructor date_default_timezone_object() is called. This function returns the current date for the current user which is in fact taking into account time zone conversion which to me is an unexpected behavior.

I propose a rework of this behavior to purely return the current date. I've already started work on a patch and will post it as soon as I have something that works.

🐛 Bug report
Status

Closed: won't fix

Version

1.0

Component

Date API

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024