Skip to content

Commit 8391b6f

Browse files
committed
Fixed parsing with timezone and no hms
1 parent 3c339b7 commit 8391b6f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/_libs/src/vendored/numpy/datetime/np_datetime_strings.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,8 @@ int parse_iso_8601_datetime(const char *str, int len, int want_exc,
742742

743743
/* Invalidates the component if there is more than 2 digits */
744744
if (sublen > 0) {
745+
if (substr[0] == 'Z')
746+
goto parse_timezone;
745747
int has_sep = 0;
746748
int j = 0;
747749
for (j = 0; j < (sublen > 2 ? 2 : sublen); ++j) {
@@ -894,6 +896,8 @@ int parse_iso_8601_datetime(const char *str, int len, int want_exc,
894896

895897
/* Invalidates the component if there is more than 2 digits */
896898
if (sublen > 0) {
899+
if (substr[0] == 'Z')
900+
goto parse_timezone;
897901
int has_sep = 0;
898902
int j = 0;
899903
for (j = 0; j < (sublen > 2 ? 2 : sublen); ++j) {

0 commit comments

Comments
 (0)