summaryrefslogtreecommitdiff
path: root/time/win32/timestr.c
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2003-01-10 23:17:33 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2003-01-10 23:17:33 +0000
commit53117157f7f3f51b8153ae6afbbee64d014688d1 (patch)
tree60069d12ccb5b5ee209d9f736a92fee09bdeea27 /time/win32/timestr.c
parent75ef9f13ee46489b79d52013659a5295eda9210d (diff)
downloadlibapr-53117157f7f3f51b8153ae6afbbee64d014688d1.tar.gz
To divine the timezone and daylight savings time, effective as of the
given date, we need to change our strategy altogether from the old FileTimeToLocalFileTime to the SystemTimeToTzSpecificLocalTime API. We also need to leave the responsibility of mapping tm_gmtoff and tm_isdst to the caller, because this isn't the function that can best guess at the gyrations. This code tests out fine after introducing %R to the win32 extra translations. However, there is still the time zone disparity since the existing tests only succeed on PST machines. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64286 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'time/win32/timestr.c')
-rw-r--r--time/win32/timestr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/time/win32/timestr.c b/time/win32/timestr.c
index 513418357..6c93c6290 100644
--- a/time/win32/timestr.c
+++ b/time/win32/timestr.c
@@ -159,7 +159,8 @@ APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t)
#ifndef _WIN32_WCE
int win32_strftime_extra(char *s, size_t max, const char *format,
- const struct tm *tm) {
+ const struct tm *tm)
+{
/* If the new format string is bigger than max, the result string won't fit
* anyway. If format strings are added, made sure the padding below is
* enough */
@@ -192,6 +193,11 @@ int win32_strftime_extra(char *s, size_t max, const char *format,
i += 2;
j += 11;
break;
+ case 'R':
+ memcpy(new_format + j, "%H:%M", 5);
+ i += 2;
+ j += 5;
+ break;
case 'T':
memcpy(new_format + j, "%H:%M:%S", 8);
i += 2;