1

I have a custom module that displays today's date and time:

t('Today: ') . date('d F - H:i')

When I change a user's time zone on their account page the time is 'magically' outputted correctly.

How does Drupal do this?

0

The magic comes from PHP's date_default_timezone_set():

Sets the default timezone used by all date/time functions in a script

Drupal uses it in

0

I've never seen the code itself, but it likely uses this: http://ca3.php.net/manual/en/datetime.settimezone.php

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.