[ic] Date time stamp

Mike Heins mike at perusion.com
Tue Dec 30 21:12:43 EST 2003


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:

I<adjust>

If you wish to temporarily adjust the time for display purposes, you
can pass an adjust parameter with the number of hours (plus or
minus).

        [time]%c[/time]
        [time adjust="-3"]%c[/time]

Will display:

 Mon 01 Jan 2001 11:29:03 AM EST
 Mon 01 Jan 2001 08:29:03 AM EST

If the number ends in zero and has 3 digits or more, it is assumed
that the number is in timezone format (i.e +500) the local time or
from GMT:

        [time]%c[/time]
        [time adjust="-330"]%c[/time]
        [time adjust="-300"]%c[/time]

Will display:

 Mon 01 Jan 2001 11:29:03 AM EST
 Mon 01 Jan 2001 07:59:03 AM EST
 Mon 01 Jan 2001 08:29:03 AM EST

If you want to force the number to be just a number of hours, add the
hours parameter:

        [time]%c[/time]
        [time adjust="100" hours=1]%c[/time]

Will display:

 Mon 01 Jan 2001 11:29:03 AM EST
 Fri 05 Jan 2001 15:29:03 PM EST

If adjust is an Interchange time duration with a suffix of sec,
min, hrs, days, or weeks, that will be used.

        [time]%c[/time]
        [time adjust="2 days"]%c[/time]

Will display:

 Mon 01 Jan 2001 11:29:03 AM EST
 Wed 03 Jan 2001 11:29:03 AM EST

Note that the time zone does not change - you should either pick a
format which doesn't display zone, use the tz parameter, or manage
it yourself.


-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295      <mike at perusion.com>

Nature, to be commanded, must be obeyed. -- Francis Bacon


More information about the interchange-users mailing list