faqts : Computers : Programming : Languages : Python : Language and Syntax

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 5 people (20%) answered Yes
Recently 0 of 1 people (0%) answered Yes

Entry

How can I get the week and dates in the following format "Week 19 (8.5. - 14.5.)"?

May 8th, 2000 22:07
unknown unknown, Scott Kain


You could use the mxDateTime module 
(http://starship.python.net/~lemburg/mxDateTime.html) and the calendar 
module that comes with the Python distribution.  Use xmDateTime for easy 
date and time addition and pass the month and year values to the 
calendar.monthcalendar() function that gives a matrix of weeks.