[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-10-19 11:49:21
|
Patches item #808465, was opened at 2003-09-18 20:21 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=808465&group_id=78018 Category: None Group: None >Status: Closed >Resolution: Fixed 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). ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2003-10-19 09:36 Message: Logged In: YES user_id=14198 Thanks! Checking in PyTime.cpp; new revision: 1.8; previous revision: 1.7 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=808465&group_id=78018 |