Syntax help please, setting a var to current day

Author Message

Arran Price

Tuesday 04 January 2005 4:47:27 pm

Hi,
Im looking for what I believe should be a one liner, to set a var to be equal to the current day (number with leading 0's if required).
I figure it should be something along the lines of:

{set
chosen_day=currentdate|datetime( custom, '%d')
}

But have tried various combinations of syntax of above with no luck.

Any help appreciated.

cheers

Arran

Michael D.

Wednesday 05 January 2005 2:53:29 am

chosen_day=currentdate()|datetime( custom, '%d') should work.
(I just added a pair of round brackets after currentdate.)

If it still does not work, then the problem might lie elsewhere and you would have to be more specific about it.

Which eZ publish version do you use?
In which context do you use these lines?
Did you init "chosen_day" with let?
How are you trying to use the var?

But that's just in case the round brackets won't do the trick.

Arran Price

Wednesday 05 January 2005 11:27:53 am

thanks, a couple of brackets did the trick.
I could have sworn I tried that as well.

Oh well.

thanks again

Arran

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 18 2025 21:10:29
Script start
Timing: Jan 18 2025 21:10:29
Module start 'layout'
Timing: Jan 18 2025 21:10:29
Module start 'content'
Timing: Jan 18 2025 21:10:30
Module end 'content'
Timing: Jan 18 2025 21:10:30
Script end

Main resources:

Total runtime1.0421 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 589.1797152.6406
Module start 'layout' 0.00590.0030 741.820339.4922
Module start 'content' 0.00891.0316 781.3125470.4063
Module end 'content' 1.04050.0015 1,251.71888.1250
Script end 1.0421  1,259.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2936160.0002
Check MTime0.00120.1196160.0001
Mysql Total
Database connection0.00090.091110.0009
Mysqli_queries0.996695.6290570.0175
Looping result0.00060.0572550.0000
Template Total1.009096.820.5045
Template load0.00220.211220.0011
Template processing1.006896.611220.5034
Template load and register function0.00020.019710.0002
states
state_id_array0.00110.102910.0011
state_identifier_array0.00280.272620.0014
Override
Cache load0.00190.1818260.0001
Sytem overhead
Fetch class attribute can translate value0.00090.084220.0004
Fetch class attribute name0.00160.151530.0005
XML
Image XML parsing0.00020.022820.0001
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00080.0759100.0001
String conversion0.00000.000940.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs