Roger -- ...and then Roger Spears said... % % Hello,
Hi!
%
% Well for my next project I'm trying to build an interactive calendar
% system using Perl/CGI.
Neat. I'd be quite interested in the finished product. I've been
searching (fruitlessly) for a calendar that will print multi-day events
in a lined-up bar across the days instead of jumbling events together.
Will yours work for me?
%
% I've got it all worked out on paper...almost, but I can't figure out how
% to get the script to actually fill in the table of boxes which represent
% the days of the month. That is to say, how can I get the script to
% figure out that the 1st of July this year was a Monday? Anyone know of
% any example scripts or snippets of code I could look at for this
% project?
You mean something like
bash-2.05a$ cal 07 2002 | head -3
July 2002
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
bash-2.05a$ \
> perl -e 'use Date::Manip;print Date_DayOfWeek("7","1","2002") . "\n";'
1
bash-2.05a$ cal 08 1968 | head -3
August 1968
Su Mo Tu We Th Fr Sa
1 2 3
bash-2.05a$ \
> perl -e 'use Date::Manip;print Date_DayOfWeek("8","1","1968") . "\n";'
4
or so? :-) If you know the epoch time of a given date then localtime
will give you the day of the week, too, but I couldn't think of a way to
get the right expr to feed localtime in thirty seconds so I fell back on
an additional module (which is quite handy, BTW).
%
% Thanks,
% Roger
HTH & HAND
:-D
--
David T-G * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg05807/pgp00000.pgp
Description: PGP signature
