<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Freemarker + current date in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22224#M10614</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also noticed this strange lack of a Date object in FreeMarker and added it to the Alfresco templating data-model. So the current date (as a new Date() Java object) can be accessed in a template as the "date" object in the root of the model. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;#assign datetimeformat="EEE, dd MMM yyyy HH:mm:ss zzz"&amp;gt;&lt;BR /&gt;${date?string(datetimeformat)}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 May 2006 14:46:28 GMT</pubDate>
    <dc:creator>kevinr</dc:creator>
    <dc:date>2006-05-08T14:46:28Z</dc:date>
    <item>
      <title>Freemarker + current date</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22223#M10613</link>
      <description>Hi there,I'm building a Freemarker template with the whole folder structure to have an&amp;nbsp; administrative overview of our Alfresco system. I need the current date in the following expression:&amp;lt;#assign modifiedToday=""&amp;gt;&amp;lt;#if "2006.05.08" == childnode.properties.modified?string("yyyy.MM.dd")&amp;gt;…d</description>
      <pubDate>Mon, 08 May 2006 12:37:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22223#M10613</guid>
      <dc:creator>simon</dc:creator>
      <dc:date>2006-05-08T12:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Freemarker + current date</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22224#M10614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also noticed this strange lack of a Date object in FreeMarker and added it to the Alfresco templating data-model. So the current date (as a new Date() Java object) can be accessed in a template as the "date" object in the root of the model. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;#assign datetimeformat="EEE, dd MMM yyyy HH:mm:ss zzz"&amp;gt;&lt;BR /&gt;${date?string(datetimeformat)}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2006 14:46:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22224#M10614</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2006-05-08T14:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Freemarker + current date</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22225#M10615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perfect, this is exactly what I needed! Thanks Kevin.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2006 15:33:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22225#M10615</guid>
      <dc:creator>simon</dc:creator>
      <dc:date>2006-05-08T15:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Freemarker + current date</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22226#M10616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;does this date get created on each call within a template or just once?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like it's just once as all my times are the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to debug a long running custom view template and see which queries are taking how long.&amp;nbsp; I was printing the time including milliseconds before and after each, but there are all identical&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I get accomplish this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thx&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I also noticed this strange lack of a Date object in FreeMarker and added it to the Alfresco templating data-model. So the current date (as a new Date() Java object) can be accessed in a template as the "date" object in the root of the model. For example:&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;#assign datetimeformat="EEE, dd MMM yyyy HH:mm:ss zzz"&amp;gt;&lt;BR /&gt;${date?string(datetimeformat)}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;Kevin&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2007 18:47:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22226#M10616</guid>
      <dc:creator>stk137</dc:creator>
      <dc:date>2007-09-04T18:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Freemarker + current date</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22227#M10617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A new Date() object is created at the start of each template execution, it is not dynamically generated each time you use it on the page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To add a dynamic Date object, you can configure in a custom class that does what you want:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://wiki.alfresco.com/wiki/Template_Guide#Custom_Root_Objects" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Template_Guide#Custom_Root_Objects&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2007 09:31:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/freemarker-current-date/m-p/22227#M10617</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-09-10T09:31:16Z</dc:date>
    </item>
  </channel>
</rss>

