# Dynamic Copyright Dates - Now it's easy in 2022

**URL:** <https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929>\
**Category:** RapidWeaver Classic\
**Created:** [January 6, 2022, 4:14am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929 "2022-01-06T04:14:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeworkman](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/joeworkman/32/23780_2.png) [@joeworkman](https://forums.realmacsoftware.com/u/joeworkman)\
**Post date:** [January 6, 2022, 4:14am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/1 "2022-01-06T04:14:07Z")

</div>

Every new year, there are messages about “Remember to update your Copyright dates”. There are several JS and PHP snippets flying around that can help you do this. I had an idea today to make this as simple as possible for you. I shipped two updates today to make your lives easier.

- Foundation v6.10.6 adds new date helper utility classes
- Tardis v1.6.0 has a new Tardis Helper stack. This will be good for non-F6 users/themes.

With these new versions, you can simply place this wherever your copyright goes…

```auto
Copyright <span class="current-year">2021</span> My Company

```

Wherever you place the `current-year` class, the contents of that will be replaced with the current year on page load. In the example above, I supplied a default of 2021. That will get replaced with the current year (now 2022) on page load.

#### But wait, there is more…

I figured while I was doing this, why stop at just the year. You have access to the following utility classes. Just like the example above, the current time data will populate where you place the class.

```auto
current-year
current-month
current-day
current-hour
current-minute
current-second
current-weekday
current-timeZoneName
current-dayPeriod

current-date
current-time
current-dateTime

```

The last 3 classes will actually output an actual full date time string. What is even better is that all output is 100% localized for the website’s language.

You have some flexibility with the formatting. The Tardis stack has options in the stack. With the Foundation 6 utility classes, there is a small JS snippet that is documented in the [Utilities class section on the F6 Demo site](https://www.foundationstacks.com/demo/site-styles/#utility).

If you don’t have Foundation 6 or Tardis, check them out…

> **[Demo | Foundation 6 Stacks for RapidWeaver](https://www.foundationstacks.com/demo/)**

> **[Tardis for Stacks Website Builder](https://www.weavers.space/stacks/tardis)**
>
> Tardis is a suite of stacks that let you control time. You can control when certain content will be displayed based on a start and end dates along with time. Tardis Days allows you to control which days of the week or month content is displayed....

---

<div class="post-metadata">

**Author:** ![joeworkman](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/joeworkman/32/23780_2.png) [@joeworkman](https://forums.realmacsoftware.com/u/joeworkman)\
**Post date:** [January 6, 2022, 4:23am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/2 "2022-01-06T04:23:34Z")

</div>

OK. While I would appreciate it if you were to purchase one of the stacks above, here is a free snippet that will give you the same functionality as above from the Copyright example.

Place this in the JavaScript tab in the site wide code in your project.

```auto
document.addEventListener("DOMContentLoaded", () => {
    Array.from(document.getElementsByClassName("current-year")).forEach(e => e.innerHTML = new Date().getFullYear());
});

```

---

<div class="post-metadata">

**Author:** ![critex](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/critex/32/23197_2.png) [@critex](https://forums.realmacsoftware.com/u/critex)\
**Post date:** [January 6, 2022, 4:34am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/3 "2022-01-06T04:34:40Z")

</div>

Damn.

---

<div class="post-metadata">

**Author:** ![Rovertek](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/rovertek/32/223_2.png) [@Rovertek](https://forums.realmacsoftware.com/u/Rovertek)\
**Post date:** [January 6, 2022, 12:39pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/4 "2022-01-06T12:39:57Z")

</div>

Hey, Joe, @joeworkman

Maybe you can help me with a different but related issue. Let me explain.

Every time I make an update to a specific page, I time-stamp that update manually. This is **not** the same as copyright – just the last update to the page. Is there a way to automate that process? It would have to change the time-stamp **only** when there is an actual change on the page, not every time the page is published. Doable?

---

<div class="post-metadata">

**Author:** ![pmjd](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pmjd/32/18671_2.png) [@pmjd](https://forums.realmacsoftware.com/u/pmjd)\
**Post date:** [January 6, 2022, 11:26pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/5 "2022-01-06T23:26:45Z")

</div>

Try this

> [@Automatic date created and date changed on a webpage (stack or snippet)](http://forums.realmacsoftware.com/t/automatic-date-created-and-date-changed-on-a-webpage-stack-or-snippet/16251/3):
>
> Try this: Page last updated: %last\_published% That’s what I use in [my themes](https://themeflood.com). RapidWeaver replaces %last\_published% with the date the page was last modified. No need for extra stacks, plugins or PHP code. I believe the macro works anywhere in the page. It will be localised to your locale (e.g mm/dd/yy or dd/mm/yy), based on your system preferences for dates.

---

<div class="post-metadata">

**Author:** ![joeworkman](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/joeworkman/32/23780_2.png) [@joeworkman](https://forums.realmacsoftware.com/u/joeworkman)\
**Post date:** [January 7, 2022, 2:09am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/6 "2022-01-07T02:09:30Z")

</div>

My Tardis stack can do this for you as well. It can display the exact date and time that the webpage was published. You have full control over the format as well.

---

<div class="post-metadata">

**Author:** ![Fuellemann](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/fuellemann/32/22871_2.png) [@Fuellemann](https://forums.realmacsoftware.com/u/Fuellemann)\
**Post date:** [January 7, 2022, 8:57am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/7 "2022-01-07T08:57:30Z")

</div>

@joeworkman The question was imho:

> It would have to change the time-stamp **only** when there is an actual change on the page, not every time the page is published. Doable?

---

<div class="post-metadata">

**Author:** ![joeworkman](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/joeworkman/32/23780_2.png) [@joeworkman](https://forums.realmacsoftware.com/u/joeworkman)\
**Post date:** [January 7, 2022, 9:37am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/8 "2022-01-07T09:37:16Z")

</div>

You could only publish the pages that you change, then that would be true.

How else would the page change without publishing it? I guess something like Total CMS. to update the content. You could then use the same CMS to update the date.

---

<div class="post-metadata">

**Author:** ![willwood](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@willwood](https://forums.realmacsoftware.com/u/willwood)\
**Post date:** [January 7, 2022, 10:28am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/9 "2022-01-07T10:28:51Z")

</div>

@pmjd Regretfully Realmac hasn’t published any changes for RapidWeaver that fixes the inability to change the format of the `%last_published%` date stamp, since I shared that information back in 2017.

@Rovertek It sounds like you need to buy a copy of my LastPublished stack. It reads the date / time the webpage was last updated and outputs it in any format you want. It will work if you edit the page outside of RapidWeaver (via FTP / text editor) too. But obviously it will not work for dynamic content coming into the page from somewhere else, like AJAX, iFrames, PDF embeds etc.

---

<div class="post-metadata">

**Author:** ![Rovertek](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/rovertek/32/223_2.png) [@Rovertek](https://forums.realmacsoftware.com/u/Rovertek)\
**Post date:** [January 7, 2022, 1:44pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/10 "2022-01-07T13:44:19Z")

</div>

Hey, Will, @willwood,

> [@willwood](#):
>
> a copy of my LastPublished stack

You mean your LastUpdated stack? Thanks for heads-up. I didn’t know that stack existed. And free, no less… Donation is on its way.

I’ll give it a try later today.

And Joe, sorry for hijacking your thread.

---

<div class="post-metadata">

**Author:** ![willwood](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@willwood](https://forums.realmacsoftware.com/u/willwood)\
**Post date:** [January 7, 2022, 2:19pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/11 "2022-01-07T14:19:04Z")

</div>

@Rovertek I’m on my phone currently. I can’t tell if this forum thread is public or not. But it was one of many new and updated addons released last year:

> [@Black Friday Shenanigans](http://forums.realmacsoftware.com/t/black-friday-shenanigans/41502):
>
> Some brilliant new and freshly updated addons to get your creative juices flowing. A number of these are FREE (although sensible “pay what you want” [donations](https://stacks4stacks.com/contribute/) are encouraged and greatly appreciated). In A-Z order… [Blank (Updated)](https://themeflood.com/blank/) A major update of the blank theme, exclusively for RapidWeaver 8 and above. Now featuring checkboxes to toggle Bootstrap and Font Awesome Icon libraries on or off. A simple yet solid theme, if you have a need to start a webpage from a blank canvas, for backend utility…

---

<div class="post-metadata">

**Author:** ![forteweb](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/forteweb/32/671_2.png) [@forteweb](https://forums.realmacsoftware.com/u/forteweb)\
**Post date:** [January 9, 2022, 6:35pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/12 "2022-01-09T18:35:20Z")

</div>

On my sites I just use some simple php code to update my copyright. In my RW project file I go to the General page in Settings. In the Footer field I enter the following:

```auto
<?php echo date("Y"); ?>

```

---

<div class="post-metadata">

**Author:** ![Pegasus](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pegasus/32/25035_2.png) [@Pegasus](https://forums.realmacsoftware.com/u/Pegasus)\
**Post date:** [January 12, 2022, 10:19pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/13 "2022-01-12T22:19:02Z")

</div>

@forteweb

Is there such a similar PHP code also for always outputting the date of the next Saturday or Sunday?

---

<div class="post-metadata">

**Author:** ![forteweb](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/forteweb/32/671_2.png) [@forteweb](https://forums.realmacsoftware.com/u/forteweb)\
**Post date:** [January 12, 2022, 10:49pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/14 "2022-01-12T22:49:07Z")

</div>

Sure. Here is some code from [w3schools.com](https://www.w3schools.com/php/php_date.asp) showing the next 6 Saturdays.

```auto
The example below outputs the dates for the next six Saturdays:

Example
<?php
$startdate = strtotime("Saturday");
$enddate = strtotime("+6 weeks", $startdate);

while ($startdate < $enddate) {
  echo date("M d", $startdate) . "<br>";
  $startdate = strtotime("+1 week", $startdate);
}
?>

```

Just modify this code to get what you need.

---

<div class="post-metadata">

**Author:** ![joeworkman](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/joeworkman/32/23780_2.png) [@joeworkman](https://forums.realmacsoftware.com/u/joeworkman)\
**Post date:** [January 12, 2022, 10:52pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/15 "2022-01-12T22:52:06Z")

</div>

There is support for smart dates like this in my Tardis Time stack.

---

<div class="post-metadata">

**Author:** ![Pegasus](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pegasus/32/25035_2.png) [@Pegasus](https://forums.realmacsoftware.com/u/Pegasus)\
**Post date:** [January 12, 2022, 11:19pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/16 "2022-01-12T23:19:14Z")

</div>

@joeworkman

Really? I bought the stack a few days ago but didn’t find that exact feature.

Where can I find the feature and are there any instructions?

---

<div class="post-metadata">

**Author:** ![joeworkman](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/joeworkman/32/23780_2.png) [@joeworkman](https://forums.realmacsoftware.com/u/joeworkman)\
**Post date:** [January 13, 2022, 1:35am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/17 "2022-01-13T01:35:50Z")

</div>

Its in Tardis Time.

![CleanShot 2022-01-12 at 17.35.13](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/3/9/3933050683cfe7dfc69582841674f0b86425da3f.jpeg)

---

<div class="post-metadata">

**Author:** ![Pegasus](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/pegasus/32/25035_2.png) [@Pegasus](https://forums.realmacsoftware.com/u/Pegasus)\
**Post date:** [January 13, 2022, 9:58am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/18 "2022-01-13T09:58:10Z")

</div>

ok. i found that section.

but, how do i create my own time-string placeholder with this Tardis-Stack similar to `current-date`, `current-year` or the `%last_published%` date stamp?

---

<div class="post-metadata">

**Author:** ![joeworkman](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/joeworkman/32/23780_2.png) [@joeworkman](https://forums.realmacsoftware.com/u/joeworkman)\
**Post date:** [January 13, 2022, 8:57pm UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/19 "2022-01-13T20:57:02Z")

</div>

If you change that `Display` setting, you will see other options like Publish Date.

As for the various classes, have a look at my live stream that I did yesterday.

[![](https://img.youtube.com/vi/qSolhQHNikI/maxresdefault.jpg "Dynamic Copyright Dates and more... Controlling Date and Time on your Websites") ](https://www.youtube.com/watch?v=qSolhQHNikI)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [February 13, 2022, 6:57am UTC](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929/20 "2022-02-13T06:57:43Z")

</div>

Closed on February 13, 2022, 6:57am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

[Next page](https://forums.realmacsoftware.com/t/dynamic-copyright-dates-now-its-easy-in-2022/41929.md?page=2)
