Author: wlux
Date: Thu Jul 16 15:54:23 2015
New Revision: 38810
URL: http://svn.gna.org/viewcvs/gnustep?rev=38810&view=rev
Log:
Use local time zone instead of GMT when parsing a date without a time zone.
Modified:
libs/sqlclient/trunk/ChangeLog
libs/sqlclient/trunk/Postgres.m
Modified: libs/sqlclient/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/ChangeLog?rev=38810&r1=38809&r2=38810&view=diff
==============================================================================
--- libs/sqlclient/trunk/ChangeLog (original)
+++ libs/sqlclient/trunk/ChangeLog Thu Jul 16 15:54:23 2015
@@ -1,3 +1,8 @@
+2015-07-16 Wolfgang Lux <[email protected]>
+
+ * Postgres.m (newDateFromBuffer): Use local time zone instead of
+ GMT when parsing a date without a time zone.
+
2015-06-29 Richard Frith-Macdonald <[email protected]>
* SQLClient.h:
Modified: libs/sqlclient/trunk/Postgres.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/sqlclient/trunk/Postgres.m?rev=38810&r1=38809&r2=38810&view=diff
==============================================================================
--- libs/sqlclient/trunk/Postgres.m (original)
+++ libs/sqlclient/trunk/Postgres.m Thu Jul 16 15:54:23 2015
@@ -100,9 +100,8 @@
newDateFromBuffer(const char *b, int l)
{
NSCalendarDate *d;
- NSTimeZone *zone;
+ NSTimeZone *zone = nil;
int milliseconds = 0;
- int timezone = 0;
int day;
int month;
int year;
@@ -143,6 +142,7 @@
hour = 0;
minute = 0;
second = 0;
+ zone = [NSTimeZone localTimeZone];
}
else
{
@@ -188,6 +188,7 @@
if (i < l && ('+' == b[i] || '-' == b[i]))
{
char sign = b[i++];
+ int timezone;
if (i >= l || !isdigit(b[i])) return nil;
timezone = b[i++] - '0';
@@ -210,17 +211,21 @@
}
if ('-' == sign)
timezone = -timezone;
- }
- }
-
- if (timezone % 60 == 0)
- {
- zone = zones[23 + timezone / 60];
- }
- else
- {
- zone = [NSTimeZone timeZoneForSecondsFromGMT: timezone * 60];
- }
+ if (timezone % 60 == 0)
+ {
+ zone = zones[23 + timezone / 60];
+ }
+ else
+ {
+ zone = [NSTimeZone timeZoneForSecondsFromGMT: timezone * 60];
+ }
+ }
+ else
+ {
+ zone = [NSTimeZone localTimeZone];
+ }
+ }
+
d = [NSCalendarDate alloc];
if (year <= 1)
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs