[ic] Date time stamp

frank frank at goldissue.com
Mon Jan 5 22:21:43 EST 2004


Anthony Minero 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?
>  
>
Anthony,

I just ripped this idea out of the Perl Cookbook by Tom Christiansen and 
Nathan Torkington:

>#!/usr/bin/perl
>  
>
($MONTHDAY, $WEEKDAY, $YEARDAY) = (localtime $DATE) [3,6,7];
print $WEEKDAY;

It prints '4' for Tuesday which doesn't make sense.

Try it for a week - then you will know for sure

;

Frank



More information about the interchange-users mailing list