• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Is there a tag for displaying the current year? For example, the copyright year?

New Here ,
Aug 12, 2012 Aug 12, 2012

Copy link to clipboard

Copied

Is there a tag for displaying the current year? For example, the copyright year? I want to put this into the site map (I guess) so it appears on each page's footer.

TOPICS
Newbie Corner

Views

2.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Jan 26, 2016 Jan 26, 2016

With the addition of Liquid you can easily accomplish this using:

{{ globals.site.dateNow | date: "yyyy" }}

Please check the documentation for more on what you can achieve with Liquid:

Introduction to Liquid‌

Liquid | Reference

Votes

Translate

Translate
LEGEND ,
Aug 12, 2012 Aug 12, 2012

Copy link to clipboard

Copied

You can get the whole date:

{module_today}

Displays today's date; for example, November 23, 2005

But not jus the year.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 12, 2012 Aug 12, 2012

Copy link to clipboard

Copied

This is a javascript/jQuery based solution that we've been using.

In a content holder at the foot of the page:

<p class="copyright">&copy; <noscript>2012</noscript><span id="copyrightYear"> </span>Company Name</p>

and then in your scripts file (as part of the document ready function)..

var yearNow = new Date().getFullYear();

$('#copyrightYear').html(yearNow);

I'm sure you could also do this with out needing jQuery. The noscript will display if the user has javascript turned off, but the majority of the time the year will be set by the script

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 13, 2012 Aug 13, 2012

Copy link to clipboard

Copied

Pretty easy to break up a site into a good Template structure with elements such as the footer content elements like this as content holders which the client can change and change site wide as well. Which is what we do.

For say a set of footer elements you build that with a web app and one web app item which allows the client more finate one location content control.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 13, 2012 Aug 13, 2012

Copy link to clipboard

Copied

I really am a newbie here. How do I do the document ready function? where do I put it and how do I do the script?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 13, 2012 Aug 13, 2012

Copy link to clipboard

Copied

You will also need to have jquery installed etc.

I wrote a guide in jQuery here:

http://forums.adobe.com/docs/DOC-1721

But if you not sure about jQuery and JavaScript maybe you should look to the other options.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 26, 2012 Nov 26, 2012

Copy link to clipboard

Copied

This seems to be dependant on the clients machine not the server time...?

I was able to change the date displayed by changing it windows...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 26, 2012 Nov 26, 2012

Copy link to clipboard

Copied

It will do.

If you want server date there is no server date. You will need to use where your located and GMT time as the reference source, heaps of scripts, JSON, XML feeds for this around the web.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 26, 2016 Jan 26, 2016

Copy link to clipboard

Copied

LATEST

With the addition of Liquid you can easily accomplish this using:

{{ globals.site.dateNow | date: "yyyy" }}

Please check the documentation for more on what you can achieve with Liquid:

Introduction to Liquid‌

Liquid | Reference

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines