[ic] Date time stamp

Aaron Hazelton aaronmail at hazenet.net
Mon Jan 5 14:00:08 EST 2004

On Mon, 05 Jan 2004 10:26:30 -0800, Anthony Minero 
<anthony at urbanscooters.com> wrote:

> On 12/30/03 6:12 PM, "Mike Heins" <mike at perusion.com> wrote:
>> Quoting Anthony Minero (anthony at urbanscooters.com):
>>> I read the developers resource notes on how to add the date to a page 
>>> and it
>>> is pretty straight forward, I'm just using;
>>> [time]%A, %B %d, %Y[/time]
>>> But I'd like to be able to show the date of the next Sunday of every 
>>> week.
>>> We have sales that end every Sunday and instead of having to manually 
>>> change
>>> the date every week I'm trying to figure out how to just display the 
>>> most
>>> recent Sundays date, if that makes sense.
>>> Anyone know how to do this? I've checked some javascript tutorials as 
>>> well
>>> to see if it could be done with JavaScript but can't seem to find 
>>> anything.
>> You should check the documentation for the time tag:
> Yeah I did that and I see how to adjust it so it always 3 hours ahead of 
> the
> real time etc. but that's not really what I need. I guess what I need is 
> an
> if/else statement that says;
> If day=Monday
> Add 6 days to the date
> Else if day=Tuesday add 5 days to the date
> Else if day=Wednesday add 4 days to the date
> Etc.
> Does anyone know how to do this?

i suppose you could do something like:
[tmp day][time]%w[/time][/tmp]
[if type="scratch" term="day" op="==" compare="1"]
day is monday, set date: [time adjust="+6 days"]%c[/time]
[elsif ... etc]

i just went through this creating some detailed date calculations. at
a certain point, you may need something like the Date::Calc module.
However, this also means that you will need to "use" that module and
thus put your code into a UserTag.

Aaron Hazelton

More information about the interchange-users mailing list