In need of a countdown (ticker)

Author Message

risto CMS user

Saturday 11 March 2006 5:02:54 am

Hi would someone show me how to doo a countdown?

from today til saome say. I would need the number of days.
pure ez

Betsy Gamrat

Saturday 11 March 2006 2:22:54 pm

Use the currentdate and datetime functions.

<b>currentdate()</b> will give you the current date, and <b>datetime</b> can be used to convert the timestamp into formats much like PHP.

For example:

{currentdate()|datetime('custom','%U')}

Be aware of timezones and date math (seconds, minutes, days, etc).

risto CMS user

Monday 13 March 2006 3:05:45 am

well this dosent print out the number of days. how dos one doo this?
how can I convert day.month.year (in numbers) to same format as datetime?

risto CMS user

Monday 13 March 2006 3:48:32 am

I need something like {mktime(0, 0, 0, 04, 09, 2006)}

Paul Borgermans

Monday 13 March 2006 4:19:08 am

See

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/miscellaneous

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

risto CMS user

Tuesday 14 March 2006 3:12:58 am

This is what I ended up with:
Its all good. ;-)

{let 
	year=currentdate()|datetime('custom','%Y')
	month=currentdate()|datetime('custom','%m')
	day=currentdate()|datetime('custom','%d')
}

{maketime( 00 ,01 ,00 ,04 , 09, 2006)|datetime('custom','%U')|sub(maketime( 00 ,01 ,00 ,$month , $day ,$year)|datetime('custom','%U'))|div(60)|div(60)|div(24)|round}

Betsy Gamrat

Tuesday 14 March 2006 6:31:07 am

Good job!

... and thanks for posting your code.

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 19 2025 06:21:51
Script start
Timing: Jan 19 2025 06:21:51
Module start 'layout'
Timing: Jan 19 2025 06:21:51
Module start 'content'
Timing: Jan 19 2025 06:21:51
Module end 'content'
Timing: Jan 19 2025 06:21:51
Script end

Main resources:

Total runtime0.6076 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 589.1484152.6250
Module start 'layout' 0.00480.0022 741.773439.4453
Module start 'content' 0.00700.5991 781.2188628.7969
Module end 'content' 0.60610.0014 1,410.015616.1641
Script end 0.6075  1,426.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00280.4686160.0002
Check MTime0.00120.1912160.0001
Mysql Total
Database connection0.00120.191710.0012
Mysqli_queries0.549490.4298710.0077
Looping result0.00060.1029690.0000
Template Total0.583496.020.2917
Template load0.00210.342520.0010
Template processing0.581395.673620.2906
Template load and register function0.00010.014210.0001
states
state_id_array0.00080.129210.0008
state_identifier_array0.00070.119820.0004
Override
Cache load0.00180.2984340.0001
Sytem overhead
Fetch class attribute can translate value0.00060.106030.0002
Fetch class attribute name0.00110.1782100.0001
XML
Image XML parsing0.00130.219930.0004
class_abstraction
Instantiating content class attribute0.00000.0045140.0000
General
dbfile0.00090.1536290.0000
String conversion0.00000.001040.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
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs