[html-formfu] time_zone with DateTime element
Carl Franks
fireartist at gmail.com
Thu Mar 25 14:20:55 GMT 2010
On 25 March 2010 11:30, rahed <raherh at gmail.com> wrote:
> Hi,
>
> I've got a config file for DateTime element along these lines:
>
> elements:
> - type: DateTime
> name: date
> label: From
> default_natural: now
> field_order: ['day','month','year','hour']
> hour:
> time_zone: Europe/Berlin
>
> I am not able to set a local hour, it's always utc time.
>
> Getting the local hour from DateTime object is ok:
>
> $dt = DateTime->now(time_zone = 'Europe/Berlin');
> $hour = $dt->hour();
>
> Is it possible to set the current hour?
I've added a new method on the Date element (which DateTime
subclasses) that allows you to set values on the DateTime object
before it's used.
See the docs for details.
It's in svn -r1698, and will be in the next CPAN release.
Cheers,
Carl
More information about the HTML-FormFu
mailing list