strange l10n behaviour (shortdatetime)

Author Message

Marko Žmak

Wednesday 10 May 2006 1:03:10 pm

I encountered a strange behaviour when using operator l10n( shortdatetime). I used this code:

{def $search_date=currentdate() $one_hour=3600 $one_day=mul(24,$one_hour)}
{def $search_date=mul(floor(div($search_date,$one_day)),$one_day)}
{$search_date|l10n( 'shortdatetime' )}

What I actually did here is divide the current timestamp with duration (in seconds) of one day, truncated the decimals and then multiplyed it with the duration a day. This should give me exactly the current date at midnight. But it gives me:

10.05.2006. 02:00

The currentdate was 10.05.2006. 21:44 (GMT +1). I checked it with server time which was Wed May 10 21:44:29 CEST 2006.

Can someone tell me where does this difference come from. I understand that I'm in GMT+1, but then it could be only on hour past the midnight, and not 2 hours. I'm really confused about this one.

Is there something wrong with currentdate() of l10n operator? Or am I missing something?

P.S. The timestamps for $serach_date are:

1147290285 - before dividng and multiplying
1147219200 - after diidng and multiplying

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 21 2025 02:48:38
Script start
Timing: Jan 21 2025 02:48:38
Module start 'layout'
Timing: Jan 21 2025 02:48:38
Module start 'content'
Timing: Jan 21 2025 02:48:39
Module end 'content'
Timing: Jan 21 2025 02:48:39
Script end

Main resources:

Total runtime0.9638 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 593.7891151.2109
Module start 'layout' 0.00580.0029 745.000036.6484
Module start 'content' 0.00870.9542 781.6484498.6875
Module end 'content' 0.96290.0008 1,280.33598.0000
Script end 0.9638  1,288.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3693160.0002
Check MTime0.00130.1366160.0001
Mysql Total
Database connection0.00060.059610.0006
Mysqli_queries0.926296.1037460.0201
Looping result0.00060.0655440.0000
Template Total0.933896.920.4669
Template load0.00250.260420.0013
Template processing0.931396.632120.4657
Template load and register function0.00010.010410.0001
states
state_id_array0.00090.090710.0009
state_identifier_array0.00090.094020.0005
Override
Cache load0.00220.2249140.0002
Sytem overhead
Fetch class attribute can translate value0.00080.079310.0008
Fetch class attribute name0.00060.067420.0003
XML
Image XML parsing0.00060.064610.0006
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00090.0962180.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs