Randal L. Schwartz wrote:
>     MATCH FAILED
>      input: [[% USE day = date(format => '%A', locale => 'en_GB') %]\n[% 
> day.format('4:20:00 13-9-2000') %]\n]
>     expect: [Tuesday]
>     output: [Wednesday]
>     FAILED 25:  - September 13th 2000 did not match expected
>     not ok 25 - September 13th 2000 did not match expected

It looks like the date plugin is working as expected.  The part that is 
broken is the code that generates the expected string of 'Wednesday', 
the nowloc() subroutine.

  -- expect --
  -- process --
  [% # 4:20:00 9-13-2000 equals 968818800 seconds since the epoch
     nowloc(968818800, '%A', 'en_GB')
  %]

For some reason it is generating the incorrect value of 'Tuesday' on 
your system, rather than 'Wednesday'.  I suspect that time zones are 
being taken into account when they shouldn't.  If you're more than 4 
hours behind GMT then 4:10 on Wednesday would, in local time, end up on 
Tuesday.

Can you try changing the localtime() at line 66 of t/date.t to gmtime() 
and see if that fixes it?

Thanks
A



_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to