Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-01-25 15:43
Flavor·PCRE (Legacy)

/
^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(Z|[\+-]\d{2}:?\d{2})?$
/
gm
Open regex in editor

Description

Should match one of the valid ISO 8601 datetime formats accepted by Forecast.io API: [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS] with an optional time zone formatted as Z for GMT time or {+,-}[HH]:[MM] (with or without separating colon) for an offset

Submitted by Clifford Paulick