Field formatting Options
tonyforgan
Posted: Monday, March 17, 2008 5:11:47 AM
Rank: Newbie

Joined: 3/17/2008
Posts: 4
Hi,

Wondering if it is possible to format a date type document property to be a different date format. When I use the following in my xslt
Code:
<xsl:value-of select="data [@alias = 'PositionCloseDate']"/>
I get a date format in timestamp format eg "2008-03-28T00:00:00". I would like to format it to be "dd/mm/yyyy".

Also, can someone suggest any good online xslt learning resources?

Thanks,

Tony Forgan
drobar
Posted: Monday, March 17, 2008 2:16:09 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,408
Location: KY, USA
There are a couple ways you can format a date field. The built-in umbraco functions have the advantage of formatting the date according to localization rules automatically.

<xsl:value-of select="umbraco.library:FormatDateTime('String Date', 'String Format')"/>


You can read more about it at http://forum.umbraco.org/20383#post-20396 and http://en.wikibooks.org/wiki/Umbraco/Reference/umbraco.library/FormatDateTime

You might also use the Exslt.ExsltDatesAndTimes functions.


cheers,
doug.

MVP 2007-2009 - Official Umbraco Trainer for North America - Percipient Studios
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.