Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Barry 99 posts 187 karma points
    Oct 08, 2009 @ 17:41
    Barry
    0

    Day format , forcing leading zero.

    I have this:

    <xsl:value-of select="umbraco.library:FormatDateTime(data [@alias='eventDate'], 'DD')"/>

     

    How do I force it to have the leading zero.. e.g. I want to display 03 not 3.

  • dandrayne 1138 posts 2262 karma points
    Oct 08, 2009 @ 18:16
    dandrayne
    1

    From ->  http://en.wikibooks.org/wiki/Umbraco/Reference/umbraco.library/FormatDateTime

    Month

    MMMM = Full month name spelled out ('August')
    MMM = Abbreviated month name ('Aug')
    MM = 2 digit month ('08')
    M = 1 or 2 digit month ('8')



    Day

    dddd = Full day of week ('Thursday')
    ddd = Abbreviated day of the week ('Thu')
    dd = 2 digit day ('06')
    d = 1 or 2 digit day ('6')



    Year

    y or yy = 2 digit year ('99')
    yyyy = 4 digit year ('1999')



    Hour

    h = 1 or 2 digit hour ('9')
    hh = 2 digit hour ('09')
    H = 24 hour ('21')



    Minute

    m = 1 or 2 digit minute ('3')
    mm = 2 digit minute('03')

    Hope this helps,
    Dan

  • bob baty-barr 1180 posts 1294 karma points MVP
    Oct 08, 2009 @ 18:27
    bob baty-barr
    0

    could it be a casing issue?? dd vs DD

     

    let us know what you discover.

  • Barry 99 posts 187 karma points
    Oct 09, 2009 @ 14:49
    Barry
    0

    dd works.. just thought I needed something else. Thank you so much.

Please Sign in or register to post replies

Write your reply to:

Draft