[Zope-CMF] formatting dtml-Date

Bjorn Stabell bjorn@exoweb.net
Thu, 14 Jun 2001 11:58:13 +0800


I find Date() quite useful, so useful that I use it all the time and
send it through ZopeTime (_.DateTime).  If the publisher specified
effective date, it'll show that, otherwise it'll show the modified date.
Very handy; I always use it to show the date of content.  I also wish
there was a DateTime version of it; how about just using date() for it?

The semantics fit quite nicely in that publishers sometimes want to
control the 'publishing date', but sometimes they don't care and don't
specify one.  If it wasn't for Date(), I would have to check manually if
effective date was set; if not, I would use bobobase_modification_time.

-----Original Message-----
From: Tres Seaver [mailto:tseaver@palladion.com]
Posted At: Thursday, June 14, 2001 10:58
Posted To: Zope CMF
Conversation: [Zope-CMF] formatting dtml-Date
Subject: Re: [Zope-CMF] formatting dtml-Date


Jens Quade wrote:

> Ben Riga <briga@borland.com> writes:
>=20
>=20
>>reformatted but are probably not the dates I want.  I think that I
need the
>>"Date" date in an object that I can manipulate using something like:
>><dtml-var created fmt=3D"%a %b %d">
>>
>=20
> The default DublinCore Implementation returns strings in ISO 8601?=20
> format. A very useful string representation of a date, but to=20
> reformat it you have to construct a DateTime object from it:
>=20
> e.g. <dtml-var "_.DateTime(CreationDate)" fmt=3D"...">


  - The stock DublinCore methods (Date, CreationDate, EffectiveDate,
    ExpirationDate, ModificationDate) return strings;

  - the "searchable" DC methods return DateTime objects (created,
    effective, expires, modified)

You will need to use the "searchable" ones if you want to reformat.

BTW, the plain "Date" is only there for compatibility with the
*quite lame* DublinCore element;  its semantics are so weak as to
make it fundamentally useless for our purposes.

Tres.


_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf

See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests