2

I have a date field with default value set to now. I have selected the site's timezone in the date field settings.

So for every user the date field value should be according to the site's timezone. But on node forms I can see the date field value is different for every user according to the timezone set on that user profile form.

Why the field value is not according to the site's timezone. it should be same for all the users.

If I disable this settings Users may set their own time zone in the regional settings then every thing works fine.

Is there any configuration I'm missing?

0

In Drupal, dates stored in the DB do not have any timezone fixed to them; it presumes all date fields are consistent in timezone and relies on the system's timezone setting to offset everything to its correct date for displaying.

There are two different offset settings: the field's timezone settings (which adjust from user's timezone input to the site's timezone) & the user's timezone setting which adjust display from the site's timezone to the user's timezone.

Needless to say, the various offset settings can make for a confusing situation to adjust to your needs.

If you want to keep the field adjusted to the site's settings and have the users still adjust for their own time zone, you should customize the display of your field so the time zone is presented in an unambiguous format.

  • I want the input should be same for all users according to the timezone set for the site. I did not want the input should vary according to the user's timezone. – Ahmad Apr 17 '17 at 8:11
  • What you're asking is kind of vague, but the main reply gets to the heart of the problem (what is being offset and where). I updated the conclusion bas on what you said; if you look at your DB, you'll see all dates are fixed when setting the field to the site's timezone. The issue is how to display the offsetting. – Shawn Conn Apr 17 '17 at 16:24
  • My requirements are exactly the same according to your answer's last paragraph. so you mean we should just play with the display in the input? – Ahmad Apr 18 '17 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.