Jennifer G. wrote:
How do I know this day is in NO. which week in this year?
for example, Jan 1 is in the no.1 week of this year.
but how about the current day?

It depends on how you define "week".  The simple answer is:

$ perl -le'print int( ( localtime )[ 7 ] / 7 )'
13


Perhaps have a look at the Date::Calc and Date::Manip modules (or many of the other Date related modules on CPAN.)


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to