This patch gives format_date() the ability to use PHP5 timezones when printing a date, or if not available, it will continue to use the PHP4 compatibility mode with offsets.

The format, langcode, offset and timezone parameters are moved into a "params" array.

See also discussion here: http://groups.drupal.org/node/3407

Comments

mfb’s picture

StatusFileSize
new15.48 KB

Also fix up all occurrences of format_date() in core.

karens’s picture

This goes with the patch at http://drupal.org/node/11077, which creates the date_handle_timezones() function and other necessary infrastructure.

mfb’s picture

StatusFileSize
new15.47 KB

Try to fix comment re: PHP version. Still not clear precisely which point version of PHP we are requiring.

karens’s picture

The reason for creating date_handle_timezones() is that we can tweak it as we figure out exactly what versions we require to do what we want to do. I would keep the document generic, i.e. 'Using native timezone handling mode' instead of naming a specific version.

Also, I see you omitted the 'r' format from the native timezone handling code and added it to the non-translated dates. You have to run that one back through format_date() as is done with the offset handling because there are parts of the format that need translating.

Have you done any testing to see if the dates are correctly computed?

mfb’s picture

StatusFileSize
new15.59 KB

Thanks for catching that.

The patches do work in my testing. However, it might be good to merge them into one patch if we can't get enough people to test them otherwise.

mfb’s picture

I have merged the two patches, you can find it at http://drupal.org/node/11077

webchick’s picture

Status: Needs review » Closed (duplicate)