week in a year

2008-04-02 Thread Jennifer G.
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? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: week in a year

2008-04-02 Thread Rob Coops
If you are calculating it your self and assuming you are intrested in the ISO defenition of the week number: http://www.proesite.com/timex/wkcalc.htm Of course there are modules on CPAN that do the same but then again, if all you want to know is the number of the week it might be simpler to calcul

Re: week in a year

2008-04-02 Thread John W. Krahn
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

Re: week in a year

2008-04-02 Thread Rob Dixon
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's a little more complicated than that. Week one is the first week in the year that has four or more days, so if Jan 1 falls on a

Re: week in a year

2008-04-04 Thread Ben Bullock
On Apr 2, 9:00 pm, [EMAIL PROTECTED] (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? This seems to be a frequently asked question: http://perldoc.perl.org/perlfaq4.html#How-do-