Skip to content

Commit f1fada6

Browse files
committed
Add additional pattern for datetime w/o timezone
1 parent ca6a39c commit f1fada6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ mod format {
8080
pub const YYYYMMDDHHMMSS_HYPHENATED_OFFSET: &str = "%Y-%m-%d %H:%M:%S %#z";
8181
pub const YYYYMMDDHHMMSS_HYPHENATED_ZULU: &str = "%Y-%m-%d %H:%M:%SZ";
8282
pub const YYYYMMDDHHMMSS_T_SEP_HYPHENATED_OFFSET: &str = "%Y-%m-%dT%H:%M:%S%#z";
83+
pub const YYYYMMDDHHMMSS_T_SEP_HYPHENATED_ZULU: &str = "%Y-%m-%dT%H:%M:%SZ";
8384
pub const YYYYMMDDHHMMSS_T_SEP_HYPHENATED_SPACE_OFFSET: &str = "%Y-%m-%dT%H:%M:%S %#z";
8485
pub const YYYYMMDDHHMMS_T_SEP: &str = "%Y-%m-%dT%H:%M:%S";
8586
pub const UTC_OFFSET: &str = "UTC%#z";
@@ -88,7 +89,7 @@ mod format {
8889

8990
/// Whether the pattern ends in the character `Z`.
9091
pub(crate) fn is_zulu(pattern: &str) -> bool {
91-
pattern == YYYYMMDDHHMMSS_HYPHENATED_ZULU
92+
pattern == YYYYMMDDHHMMSS_HYPHENATED_ZULU || pattern == YYYYMMDDHHMMSS_T_SEP_HYPHENATED_ZULU
9293
}
9394

9495
/// Patterns for datetimes with timezones.
@@ -113,10 +114,11 @@ mod format {
113114
/// Patterns for datetimes without timezones.
114115
///
115116
/// These are in decreasing order of length.
116-
pub(crate) const PATTERNS_NO_TZ: [(&str, usize); 8] = [
117+
pub(crate) const PATTERNS_NO_TZ: [(&str, usize); 9] = [
117118
(YYYYMMDDHHMMSS, 29),
118119
(POSIX_LOCALE, 24),
119120
(YYYYMMDDHHMMSS_HYPHENATED_ZULU, 20),
121+
(YYYYMMDDHHMMSS_T_SEP_HYPHENATED_ZULU, 20),
120122
(YYYYMMDDHHMMS_T_SEP, 19),
121123
(YYYYMMDDHHMMS, 19),
122124
(YYYY_MM_DD_HH_MM, 16),

0 commit comments

Comments
 (0)