[pywin32-bugs] [ pywin32-Patches-808465 ] Fix PyTime.Format
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2003-09-18 10:21:33
|
Patches item #808465, was opened at 2003-09-18 12:21 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=808465&group_id=78018 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: David Fraser (davidfraser) Assigned to: Nobody/Anonymous (nobody) Summary: Fix PyTime.Format Initial Comment: currently PyTime.Format does not return proper values for day of week and day of year. This is because these are not set in the tm struct that is given to _tcsftime This patch fixes that by calling mktime to convert to a time_t representation, and localtime to convert it back. This is done because although day of week is available in SYSTEMTIME as st.wDayOfWeek, day of year is not available and it would be fairly complex to calculate (I don't know another system function that will do this). In addition, I increased the buffer size for the Format for 256 (I was getting blank strings returned when testing long format strings - see patch 808464 which contains a test for PyTime.Format). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=808465&group_id=78018 |