Date datatype formating

Author Message

Brendan Pike

Monday 19 May 2003 9:42:34 pm

In a template I currently use
{attribute_view_gui attribute=$content_version.data_map.dateline}
Which produces 2002.12.20 or whatever the user placed in the fields.

My question is can I format these to look like
Friday 20 December 2002

I tried
{attribute_view_gui attribute=$content_version.data_map.dateline.data_int|l10n(date)}
and similar variables without luck.

Can anyone help?

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Selmah Maxim

Tuesday 20 May 2003 12:34:42 am

Hi ..

tyr this :

{attribute_view_gui attribute=$content_version.data_map.dateline.data_int|l10n(datetime(custom,"%l %d %F %Y")} )}

look at SDK Date : sdk/eztemplate/view/operator_list/

and at php.net :
http://www.php.net/manual/en/function.date.php

Brendan Pike

Tuesday 20 May 2003 4:53:05 am

Thanks for the suggestion but it didn't work. I tried lots of variables of your suggestion but without result. It usually doesn't show anything or simply outputs the same numerical dates.

Still open for suggsetions though :)

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

Selmah Maxim

Tuesday 20 May 2003 9:59:51 am

as i unserstand from ur 1st post, that date format what ur have is 2002.12.20, then u will need to convert it to timestamp to use this option in the template language !
try this

{$content_version.data_map.published|datetime(custom,"%l %d %F %Y")}

if u got as u want, then ok, if not then u need to translate the date in the local files/ files maybe !

Brendan Pike

Thursday 22 May 2003 9:28:40 am

Thanks for everyones help. For anybody with similar challenges the solutiuon ended up looking like this:

{section show=count($content_version.data_map.dateline.data_int)|gt(1)}
{$content_version.data_map.dateline|l10n(date)}

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

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

Main resources:

Total runtime0.9038 sec
Peak memory usage8,192.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.1250151.2109
Module start 'layout' 0.00510.0031 739.3359220.6875
Module start 'content' 0.00820.8948 960.02344,325.9063
Module end 'content' 0.90310.0007 5,285.929711.8594
Script end 0.9038  5,297.7891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3705160.0002
Check MTime0.00120.1318160.0001
Mysql Total
Database connection0.00080.083210.0008
Mysqli_queries0.824091.1770630.0131
Looping result0.00050.0587610.0000
Template Total0.860095.220.4300
Template load0.00200.226420.0010
Template processing0.858094.930020.4290
Template load and register function0.00180.197310.0018
states
state_id_array0.00090.101810.0009
state_identifier_array0.00060.071620.0003
Override
Cache load0.00170.1908310.0001
Sytem overhead
Fetch class attribute can translate value0.00170.186220.0008
Fetch class attribute name0.00250.272450.0005
XML
Image XML parsing0.00020.022120.0001
class_abstraction
Instantiating content class attribute0.00000.001550.0000
General
dbfile0.00050.0589100.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs