Skip to content

Commit b90f282

Browse files
committed
cut mapping from int(Python) to TIMESTAMP
1 parent 00952af commit b90f282

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/gstype_python.i

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,12 @@ static bool convertObjectToGSTimestamp(PyObject* value, GSTimestamp* timestamp)
304304
return true;
305305
} else if (checkPyObjIsLong(value)) {
306306
utcTimestamp = PyLong_AsLong(value);
307-
if (utcTimestamp > UTC_TIMESTAMP_MAX) {
307+
if (utcTimestamp == 0) { // int type for timestamp input is not correct except 0 value.
308+
*timestamp = 0;
309+
return true;
310+
} else {
308311
return false;
309312
}
310-
*timestamp = utcTimestamp * 1000; // convert from seconds to miliseconds
311-
return true;
312313
} else {
313314
// Invalid input
314315
return false;

0 commit comments

Comments
 (0)