Skip to content

Commit cda5ba7

Browse files
committed
use directly gsParseTime() to parse input string
1 parent b8bb89d commit cda5ba7

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/gstype_python.i

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -414,23 +414,11 @@ static bool convertObjectToGSTimestamp(PyObject* value, GSTimestamp* timestamp)
414414
if (!SWIG_IsOK(res)) {
415415
return false;
416416
}
417-
// error when string len is too short
418-
if (strlen(v) < 19) {
419-
cleanString(v, alloc);
420-
return false;
421-
}
422-
// this is for convert python's string datetime (YYYY-MM-DDTHH:mm:ss:sssZ)
423-
// to griddb's string datetime (YYYY-MM-DDTHH:mm:ss.sssZ)
424-
v[19] = '.';
425-
//Date format is YYYY-MM-DDTHH:mm:ss.sssZ
426-
427417
retConvertTimestamp = gsParseTime(v, timestamp);
428418
cleanString(v, alloc);
429-
430419
return (retConvertTimestamp == GS_TRUE);
431420
} else if (PyFloat_Check(value)) {
432421
// Input is python utc timestamp
433-
//utcTimestamp = PyFloat_AsDouble(value);
434422
vbool = convertObjectToDouble(value, &utcTimestamp);
435423
if (!vbool) {
436424
return false;

0 commit comments

Comments
 (0)