ex
Fork of mbed-os-example-mbed5-blinky by
Diff: dumi_doc-master/schema/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php
- Revision:
- 49:b9eb462f36a9
- Parent:
- 48:c7ee67edcf1d
- Child:
- 50:9ecaa144d1f3
--- a/dumi_doc-master/schema/vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php Tue Jul 18 16:56:22 2017 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<?php
-
-namespace JsonSchema;
-
-class Rfc3339
-{
- const REGEX = '/(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(\.\d+)?(Z|([+-]\d{2}):?(\d{2}))/';
-
- /**
- * Try creating a DateTime instance
- *
- * @param string $string
- * @return \DateTime|null
- */
- public static function createFromString($string)
- {
- if (!preg_match(self::REGEX, strtoupper($string), $matches)) {
- return null;
- }
-
- $dateAndTime = $matches[1];
- $microseconds = $matches[2] ?: '.000000';
- $timeZone = 'Z' !== $matches[3] ? $matches[4] . ':' . $matches[5] : '+00:00';
-
- $dateTime = \DateTime::createFromFormat('Y-m-d\TH:i:s.uP', $dateAndTime . $microseconds . $timeZone, new \DateTimeZone('UTC'));
-
- return $dateTime ?: null;
- }
-}
