Copied to clipboard

Flag this post as spam?

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


  • Kyle Skrinak 272 posts 327 karma points
    Dec 30, 2010 @ 21:59
    Kyle Skrinak
    0

    Inserting the current date and time

    A simple problem, I'm sure. I wish to add the current date/time into a meta tag, something where the rendered code would look like:

    <meta name="Copyright" content="Copyright&copy; 12/30/2010 18:00" />

    I'm aware of the following xslt: <xsl:value-of select="umbraco.library:CurrentDate()"/>

    So, I created a "Clean" macro, inserted the above line just below the line/div>
  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 30, 2010 @ 22:10
    Jan Skovgaard
    1

    Hi Kyle

    If you're using the CurrenDate() extension I guess what you need to do is format the output with FormatDateTime

    <xsl:variable name="currentDate select="umbraco.library:CurrentDate()" />

    <xsl:value-of select="umbraco.library:FormatDateTime($currentDate,'MM/dd/yyyy hh:mm')" />

    I think this should do the trick for you. You can read more about the manipulation options with FormatDateTime here: http://our.umbraco.org/wiki/reference/umbracolibrary/formatdatetime

    Hope this helps.

    /Jan

  • Kyle Skrinak 272 posts 327 karma points
    Dec 30, 2010 @ 22:13
    Kyle Skrinak
    0

    Thanks Jan -- That did the trick!

Please Sign in or register to post replies

Write your reply to:

Draft