[Python-ideas] Add a "week" function or attribute to datetime.date
Hi, datetime.date.today() (or other day) has attributes .year and .month wich return the year and the month of that date, also it has a function weekday() wich return the number of the day in the week. I think it is a good idea add a function or attribute "week" wich return the number of the week on the year. It is useful to execute scripts once a week for example. ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] Add a "week" function or attribute to datetime.date
I like the idea. But how to distinguish it from the number of week past since the beginning of the month ? But that’s great. On Fri 1 Mar 2019 at 09:31, Antonio Galán wrote: > Hi, datetime.date.today() (or other day) has attributes .year and .month > wich return the year and the month of that date, also it has a function > weekday() wich return the number of the day in the week. > > I think it is a good idea add a function or attribute "week" wich return > the number of the week on the year. It is useful to execute scripts once a > week for example. > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] Add a "week" function or attribute to datetime.date
The week number is usually refered to the week of the year, but the week of the month is also interesting, for example for some holiday which depend on the week number of the month, so in analogy with "weekday" we can use "yearweek" and "monthweek" El vie., 1 de marzo de 2019 9:33, Adrien Ricocotam escribió: > I like the idea. But how to distinguish it from the number of week past > since the beginning of the month ? > > But that’s great. > > On Fri 1 Mar 2019 at 09:31, Antonio Galán wrote: > >> Hi, datetime.date.today() (or other day) has attributes .year and .month >> wich return the year and the month of that date, also it has a function >> weekday() wich return the number of the day in the week. >> >> I think it is a good idea add a function or attribute "week" wich return >> the number of the week on the year. It is useful to execute scripts once a >> week for example. >> ___ >> Python-ideas mailing list >> Python-ideas@python.org >> https://mail.python.org/mailman/listinfo/python-ideas >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] Add a "week" function or attribute to datetime.date
Currently one can do week = d.isocalendar()[1] The iso definition of a week number has some nice properties. robertvandeneynde.be On Fri, 1 Mar 2019, 11:44 Antonio Galán, wrote: > The week number is usually refered to the week of the year, but the week > of the month is also interesting, for example for some holiday which depend > on the week number of the month, so in analogy with "weekday" we can use > "yearweek" and "monthweek" > El vie., 1 de marzo de 2019 9:33, Adrien Ricocotam > escribió: > >> I like the idea. But how to distinguish it from the number of week past >> since the beginning of the month ? >> >> But that’s great. >> >> On Fri 1 Mar 2019 at 09:31, Antonio Galán wrote: >> >>> Hi, datetime.date.today() (or other day) has attributes .year and >>> .month wich return the year and the month of that date, also it has a >>> function weekday() wich return the number of the day in the week. >>> >>> I think it is a good idea add a function or attribute "week" wich return >>> the number of the week on the year. It is useful to execute scripts once a >>> week for example. >>> ___ >>> Python-ideas mailing list >>> Python-ideas@python.org >>> https://mail.python.org/mailman/listinfo/python-ideas >>> Code of Conduct: http://python.org/psf/codeofconduct/ >>> >> ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] Add a "week" function or attribute to datetime.date
There are all sorts of "Calendar" operations one might want -- I think those belong in a separate library, rather than a few tacked on to datetime. -CHB On Fri, Mar 1, 2019 at 2:48 AM Robert Vanden Eynde wrote: > Currently one can do week = d.isocalendar()[1] > > The iso definition of a week number has some nice properties. > > robertvandeneynde.be > > On Fri, 1 Mar 2019, 11:44 Antonio Galán, wrote: > >> The week number is usually refered to the week of the year, but the week >> of the month is also interesting, for example for some holiday which depend >> on the week number of the month, so in analogy with "weekday" we can use >> "yearweek" and "monthweek" >> El vie., 1 de marzo de 2019 9:33, Adrien Ricocotam >> escribió: >> >>> I like the idea. But how to distinguish it from the number of week past >>> since the beginning of the month ? >>> >>> But that’s great. >>> >>> On Fri 1 Mar 2019 at 09:31, Antonio Galán wrote: >>> Hi, datetime.date.today() (or other day) has attributes .year and .month wich return the year and the month of that date, also it has a function weekday() wich return the number of the day in the week. I think it is a good idea add a function or attribute "week" wich return the number of the week on the year. It is useful to execute scripts once a week for example. ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/ >>> ___ >> Python-ideas mailing list >> Python-ideas@python.org >> https://mail.python.org/mailman/listinfo/python-ideas >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] Add a "week" function or attribute to datetime.date
If anybody is looking for such components then wx.DateTime (https://wxpython.org/Phoenix/docs/html/datetime_overview.html) it is derived from wxDateTime (https://docs.wxwidgets.org/3.1/classwx_date_time.html) and should support all of its methods including things like DST changes, etc., supported dates from about 4714 B.C. to some 480 million years in the future. From: Python-ideas On Behalf Of Christopher Barker Sent: 04 March 2019 21:09 To: python-ideas Subject: Re: [Python-ideas] Add a "week" function or attribute to datetime.date There are all sorts of "Calendar" operations one might want -- I think those belong in a separate library, rather than a few tacked on to datetime. -CHB On Fri, Mar 1, 2019 at 2:48 AM Robert Vanden Eynde mailto:robertv...@gmail.com>> wrote: Currently one can do week = d.isocalendar()[1] The iso definition of a week number has some nice properties. robertvandeneynde.be<http://robertvandeneynde.be> On Fri, 1 Mar 2019, 11:44 Antonio Galán, mailto:angala@gmail.com>> wrote: The week number is usually refered to the week of the year, but the week of the month is also interesting, for example for some holiday which depend on the week number of the month, so in analogy with "weekday" we can use "yearweek" and "monthweek" El vie., 1 de marzo de 2019 9:33, Adrien Ricocotam mailto:ricoco...@gmail.com>> escribió: I like the idea. But how to distinguish it from the number of week past since the beginning of the month ? But that’s great. On Fri 1 Mar 2019 at 09:31, Antonio Galán mailto:angala@gmail.com>> wrote: Hi, datetime.date.today() (or other day) has attributes .year and .month wich return the year and the month of that date, also it has a function weekday() wich return the number of the day in the week. I think it is a good idea add a function or attribute "week" wich return the number of the week on the year. It is useful to execute scripts once a week for example. ___ Python-ideas mailing list Python-ideas@python.org<mailto:Python-ideas@python.org> https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/ ___ Python-ideas mailing list Python-ideas@python.org<mailto:Python-ideas@python.org> https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/ ___ Python-ideas mailing list Python-ideas@python.org<mailto:Python-ideas@python.org> https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/ -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
Re: [Python-ideas] Add a "week" function or attribute to datetime.date
On Mon, Mar 4, 2019 at 10:00 PM Steve Barnes wrote: > If anybody is looking for such components then wx.DateTime > There has got to be a stand alone python library for that! Anyone know the status of the venerable mxDateTime? -CHB -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/