Display the date formats and methods available in Zope

Here are the list of different format of Zope date formats and methos you can play around. Various method I have used to generate different format of date which can be used as per requirement in Zope framework.

This table of formats and methods I particular liked it while playing with DTML and Page Template.

 

Formats

  • strftime(%Y/%m/%d) –> 2011/03/10
  • strftime(%a) –> Thu
  • strftime(%A) –> Thursday
  • strftime(%b) –> Mar
  • strftime(%B) –> March
  • strftime(%c) –> 03/10/11 14:21:06
  • strftime(%d) –> 10
  • strftime(%H) –> 14
  • strftime(%I) –> 02
  • strftime(%j) –> 069
  • strftime(%m) –> 03
  • strftime(%M) –> 21
  • strftime(%p) –> PM
  • strftime(%s) –>
  • strftime(%U) –> 10
  • strftime(%w) –> 4
  • strftime(%W) –> 10
  • strftime(%x) –> 03/10/11
  • strftime(%X) –> 14:21:06
  • strftime(%y) –> 11
  • strftime(%Y) –> 2011
  • strftime(%Z) –>

 

Methods of Date Objects

  • dow() –> 4
  • aCommon() –> Mar 10, 2011 2:21 pm
  • h_12() –> 2
  • HTML4() –> 2011-03-10T14:21:06Z
  • dayOfYear() –> 69
  • AMPM() –> 02:21:06 pm
  • Month() –> March
  • mm() –> 03
  • ampm() –> pm
  • hour() –> 14
  • aCommonZ() –> Mar 10, 2011 2:21 pm GMT+0
  • pCommon() –> Mar. 10, 2011 2:21 pm
  • minute() –> 21
  • day() –> 10
  • Date() –> 2011/03/10
  • Time() –> 14:21:06
  • TimeMinutes() –> 14:21
  • yy() –> 11
  • dd() –> 10
  • rfc822() –> Thu, 10 Mar 2011 14:21:06 +0000
  • fCommon() –> March 10, 2011 2:21 pm
  • fCommonZ() –> March 10, 2011 2:21 pm GMT+0
  • timeTime() –> 1299766866.3 (this is a floating point number, not a string)
  • parts() –> (2011, 3, 10, 14, 21, 6.3029999999999999, ‘GMT+0’) (this is a tuple, not a string)
  • PreciseAMPM() –> 02:21:06.303 pm
  • AMPMMinutes() –> 02:21 pm
  • pDay() –> Thu.
  • h_24() –> 14
  • pCommonZ() –> Mar. 10, 2011 2:21 pm GMT+0
  • dow_1() –> 5(integer)
  • timezone() –> GMT+0
  • year() –> 2011
  • PreciseTime() –> 14:21:06.303
  • ISO() –> 2011-03-10 14:21:06
  • millis() –> 1299766866303
  • second() –> 6.303
  • month() –> 3(integer)
  • pMonth() –> Mar.
  • aMonth() –> Mar
  • Day() –> Thursday
  • aDay() –> Thu

Share

Leave a Reply

Your email address will not be published. Required fields are marked *