# Date tag oddness

**URL:** <https://www.ruby-forum.com/t/date-tag-oddness/89633>\
**Category:** Radiant CMS\
**Created:** [March 21, 2007, 6:21pm UTC](https://www.ruby-forum.com/t/date-tag-oddness/89633 "2007-03-21T18:21:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 21, 2007, 6:21pm UTC](https://www.ruby-forum.com/t/date-tag-oddness/89633/1 "2007-03-21T18:21:01Z")

</div>

I cannot for the life of me figure out what drives the decision of  
WHICH year this tag means:

\<r:date format="%Y" /\>

I have tried updating the content in the footer snippet, the Home page,  
etc. New pages get the correct year, but old pages get whatever year  
they were created in, it seems.

Is there a tag I can use that means This Year, as in what year the  
server thinks it is at the moment?

Thanks,

Walter

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 21, 2007, 6:24pm UTC](https://www.ruby-forum.com/t/date-tag-oddness/89633/2 "2007-03-21T18:24:01Z")

</div>

Walter,

The \<r:date /\> tag uses the published date of the current page. There  
is not currently a tag that gives the current date, although its  
implementation would be trivial.

Sean

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 21, 2007, 6:35pm UTC](https://www.ruby-forum.com/t/date-tag-oddness/89633/3 "2007-03-21T18:35:04Z")

</div>

Walter Lee D. wrote:

> I cannot for the life of me figure out what drives the decision of  
> WHICH year this tag means:
> 
> \<r:date format="%Y" /\>

It’s the published\_at date.

–  
John

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 21, 2007, 6:44pm UTC](https://www.ruby-forum.com/t/date-tag-oddness/89633/4 "2007-03-21T18:44:05Z")

</div>

On Mar 21, 2007, at 1:34 PM, John W. Long wrote:

> Walter Lee D. wrote:
> 
> > I cannot for the life of me figure out what drives the decision of  
> > WHICH year this tag means:
> > 
> > \<r:date format="%Y" /\>
> 
> It’s the published\_at date.

So how can I bump this date? Do I unpublish and then re-publish a page?  
And if so, which one? I would like to bump the date for the entire site  
(in the footer).

Thanks,

Walter

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 21, 2007, 8:23pm UTC](https://www.ruby-forum.com/t/date-tag-oddness/89633/5 "2007-03-21T20:23:26Z")

</div>

Walter Lee D. wrote:

> So how can I bump this date? Do I unpublish and then re-publish a page?  
> And if so, which one? I would like to bump the date for the entire site  
> (in the footer).

You would have to do that manually. Set the published\_at date to nil and  
the status to draft. Then change it to published again.

Something like this in script/console might work:

page = Page.find\_by\_url(‘/path/to/my/page’)  
page.status = Status[:draft]  
page.published\_at = nil  
page.save!  
page.status = Status[:published]  
page.save!

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![walterdavis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a587f6/32.png) [@walterdavis](https://www.ruby-forum.com/u/walterdavis)\
**Post date:** [March 21, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/date-tag-oddness/89633/6 "2007-03-21T20:51:32Z")

</div>

Thanks.

On Mar 21, 2007, at 3:22 PM, John W. Long wrote:

> > 
> 
> Something like this in script/console might work:
> 
> page = Page.find\_by\_url(’/path/to/my/page’)  
> page.status = Status[:draft]  
> page.published\_at = nil  
> page.save!  
> page.status = Status[:published]  
> page.save!

I would like to second the motion for a tag that means Current Date. I  
very often put the following in the footer of pages I make in PHP:

Copyright ©2004—\<?=date('Y',time())?\> Walter D. Studio…

That’s basically all I am after here in the footer. I had a really  
confusing journey through the Ruby documentation, trying to find the  
equivalent so I could try just writing this myself. But my lack of  
patience and experience conspired against me figuring this out.

Thanks again,

Walter
