Commits

Tuukka Norri committed d26c0da

Fixed a problem with timestamps
- Timestamps with time zones should get parsed correctly again, as long as their precision is 3.
- Also added a basic unit test.

  • Participants
  • Parent commits 90db7d5
  • Branches PGTS

Comments (0)

Files changed (1)

File Framework/Sources/PGTSAdditions.m

 + (id) newForPGTSResultSet: (PGTSResultSet *) set withCharacters: (char *) value typeInfo: (PGTSTypeInfo *) typeInfo
 {
     id rval;
-    NSString *dateString = [NSString stringWithUTF8String:value];
+    NSString* dateString = [NSString stringWithUTF8String: value];
     switch ([dateString length])
     {
         case 10:
             rval = [[self class] dateWithString:dateString calendarFormat:@"%Y-%m-%d"];
             break;
         default:
+        {
+            
             rval = [[self class] dateWithString: dateString
-                                 calendarFormat: @"%Y-%m-%d %H:%M:%S+%z"];
+                                 calendarFormat: @"%Y-%m-%d %H:%M:%S.%F+%z"];
+        }
     }
     NSAssert1 (nil != rval, @"Failed matching string %@ to date format.", dateString);
     return rval;