-- UNIX _IS_ user friendly. It's just selective about who its friends are.
Sylvain
Alain BARBET a écrit:
Par exemple : j'aimerais récupérer le numéro de semaine de la se maine dernière.
perldoc localtime, 7è valeur du tableau retourné:
Récupérer le no dans l'année du jour, lui oter 7 pour la semaine derniere, le diviser par 7 pour connaitre le no de la semaine ...
Attention, ce n'est peut-être pas si simple... En particulier, je pense que ce calcul sera faux les années ou le 01/01 tombe un jeudi
voir ISO 8601:1988
http://www.cl.cam.ac.uk/~mgk25/iso-time.html Week 01 of a year is per definition the first week that has the Thursday in this year, which is equivalent to the week that contains the fourth day of January. In other words, the first week of a new year is the week that has the majority of its days in the new year. Week 01 might also contain days from the previous year and the week before week 01 of a year is the last week (52 or 53) of the previous year even if it contains days from the new year. A week starts with Monday (day 1) and ends with Sunday (day 7). For example, the first week of the year 1997 lasts from 1996-12-30 to 1997-01-05 ...
Alain BARBET a écrit:
Par exemple : j'aimerais récupérer le numéro de semaine de la se maine
dernière.
perldoc localtime, 7è valeur du tableau retourné:
Récupérer le no dans l'année du jour, lui oter 7 pour la semaine
derniere, le diviser par 7 pour connaitre le no de la semaine ...
Attention, ce n'est peut-être pas si simple...
En particulier, je pense que ce calcul sera faux les années ou le
01/01 tombe un jeudi
voir ISO 8601:1988
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
Week 01 of a year is per definition the first week that has the Thursday
in this year, which is equivalent to the week that contains the fourth
day of January. In other words, the first week of a new year is the week
that has the majority of its days in the new year. Week 01 might also
contain days from the previous year and the week before week 01 of a
year is the last week (52 or 53) of the previous year even if it
contains days from the new year. A week starts with Monday (day 1) and
ends with Sunday (day 7). For example, the first week of the year 1997
lasts from 1996-12-30 to 1997-01-05 ...
Par exemple : j'aimerais récupérer le numéro de semaine de la se maine dernière.
perldoc localtime, 7è valeur du tableau retourné:
Récupérer le no dans l'année du jour, lui oter 7 pour la semaine derniere, le diviser par 7 pour connaitre le no de la semaine ...
Attention, ce n'est peut-être pas si simple... En particulier, je pense que ce calcul sera faux les années ou le 01/01 tombe un jeudi
voir ISO 8601:1988
http://www.cl.cam.ac.uk/~mgk25/iso-time.html Week 01 of a year is per definition the first week that has the Thursday in this year, which is equivalent to the week that contains the fourth day of January. In other words, the first week of a new year is the week that has the majority of its days in the new year. Week 01 might also contain days from the previous year and the week before week 01 of a year is the last week (52 or 53) of the previous year even if it contains days from the new year. A week starts with Monday (day 1) and ends with Sunday (day 7). For example, the first week of the year 1997 lasts from 1996-12-30 to 1997-01-05 ...
Alain BARBET
Par exemple : j'aimerais récupérer le numéro de semaine de la semaine dernière.
Récupérer le no dans l'année du jour, lui oter 7 pour la semaine derniere, le diviser par 7 pour connaitre le no de la semaine ...
Attention, ce n'est peut-être pas si simple... En particulier, je pense que ce calcul sera faux les années ou le 01/01 tombe un jeudi
C'est pour ca que j'ai mis mon énouncé avant ma tirade :-) Si je voulais etre precis, je ferais comme tjs et j'utiliserais un module ecrit pour ca, deja testé, et qui fait ca très bien ;-)
-- He papa, je ne savais pas que "FORMAT C:" faisait ca !?
Par exemple : j'aimerais récupérer le numéro de semaine de la semaine
dernière.
Récupérer le no dans l'année du jour, lui oter 7 pour la semaine
derniere, le diviser par 7 pour connaitre le no de la semaine ...
Attention, ce n'est peut-être pas si simple...
En particulier, je pense que ce calcul sera faux les années ou le
01/01 tombe un jeudi
C'est pour ca que j'ai mis mon énouncé avant ma tirade :-)
Si je voulais etre precis, je ferais comme tjs et j'utiliserais un
module ecrit pour ca, deja testé, et qui fait ca très bien ;-)
--
He papa, je ne savais pas que "FORMAT C:" faisait ca !?
Par exemple : j'aimerais récupérer le numéro de semaine de la semaine dernière.
Récupérer le no dans l'année du jour, lui oter 7 pour la semaine derniere, le diviser par 7 pour connaitre le no de la semaine ...
Attention, ce n'est peut-être pas si simple... En particulier, je pense que ce calcul sera faux les années ou le 01/01 tombe un jeudi
C'est pour ca que j'ai mis mon énouncé avant ma tirade :-) Si je voulais etre precis, je ferais comme tjs et j'utiliserais un module ecrit pour ca, deja testé, et qui fait ca très bien ;-)
-- He papa, je ne savais pas que "FORMAT C:" faisait ca !?
Jogo
Le 02 oct. 2003, Alain BARBET a écrit dans fr.comp.lang.perl :
Si je voulais etre precis, je ferais comme tjs et j'utiliserais un module ecrit pour ca, deja testé, et qui fait ca très bien ;-)
Date::Calc par exemple
Le 02 oct. 2003, Alain BARBET a écrit dans fr.comp.lang.perl :
Si je voulais etre precis, je ferais comme tjs et j'utiliserais un
module ecrit pour ca, deja testé, et qui fait ca très bien ;-)