maketime seem streng

Author Message

Coulibaly Ibrahim

Friday 30 March 2007 7:01:33 am

i have an URL like this:
domain.name.com/siteaccess/home/(my_day)/31/(my_month)/03/(my_year)/2007

and i want to get the UNIX timestamp of the "date" in this url.
i tried this code:

{def $currentDate=maketime(0,0,0,$view_parameters.my_day,$view_parameters.my_month,$view_parameters.my_year)}

that code return a strenge date like "2009/03/07"
so i tried something like

{maketime(0,0,0,31,03,2007)}

allway strenge :(
can someone explain why?
please ;)

Damien Pobel

Friday 30 March 2007 12:10:43 pm

You've swapped month and day. See doc [1]
if you don't have time values, you can use makedate [2]

[1] http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_operators/miscellaneous/maketime
[2] http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_operators/miscellaneous/makedate

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Coulibaly Ibrahim

Monday 02 April 2007 1:16:57 am

thanks a lot Damien.

the exemple on the http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_operators/miscellaneous/maketime page seems wrong.
i should read ".... 5th April 200." but it's writen "4th of May ...."
Thank you ;)

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 31 2025 04:16:46
Script start
Timing: Jan 31 2025 04:16:46
Module start 'layout'
Timing: Jan 31 2025 04:16:46
Module start 'content'
Timing: Jan 31 2025 04:16:46
Module end 'content'
Timing: Jan 31 2025 04:16:46
Script end

Main resources:

Total runtime0.0147 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.0078151.1953
Module start 'layout' 0.00500.0024 739.203136.6328
Module start 'content' 0.00740.0060 775.835990.2188
Module end 'content' 0.01340.0013 866.054733.9922
Script end 0.0147  900.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002416.4779140.0002
Check MTime0.00127.9696140.0001
Mysql Total
Database connection0.00074.933310.0007
Mysqli_queries0.002214.639330.0007
Looping result0.00000.076310.0000
Template Total0.00106.810.0010
Template load0.00085.355210.0008
Template processing0.00021.429710.0002
Override
Cache load0.00053.519810.0005
General
dbfile0.001912.933780.0002
String conversion0.00000.068240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs