OXIESEC PANEL
- Current Dir:
/
/
usr
/
share
/
php
/
JsonSchema
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/20/2024 06:32:21 AM
rwxr-xr-x
📁
Constraints
-
07/20/2024 06:32:21 AM
rwxr-xr-x
📁
Entity
-
07/20/2024 06:32:21 AM
rwxr-xr-x
📁
Exception
-
07/20/2024 06:32:21 AM
rwxr-xr-x
📁
Iterator
-
07/20/2024 06:32:21 AM
rwxr-xr-x
📄
Rfc3339.php
886 bytes
10/21/2017 01:15:38 PM
rw-r--r--
📄
SchemaStorage.php
5.29 KB
10/21/2017 01:15:38 PM
rw-r--r--
📄
SchemaStorageInterface.php
802 bytes
10/21/2017 01:15:38 PM
rw-r--r--
📁
Uri
-
07/20/2024 06:32:21 AM
rwxr-xr-x
📄
UriResolverInterface.php
530 bytes
10/21/2017 01:15:38 PM
rw-r--r--
📄
UriRetrieverInterface.php
517 bytes
10/21/2017 01:15:38 PM
rw-r--r--
📄
Validator.php
2.84 KB
10/21/2017 01:15:38 PM
rw-r--r--
📄
autoload.php
4.58 KB
10/25/2017 01:56:33 AM
rw-r--r--
Editing: Rfc3339.php
Close
<?php namespace JsonSchema; class Rfc3339 { const REGEX = '/^(\d{4}-\d{2}-\d{2}[T ]{1}\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'; $dateFormat = strpos($dateAndTime, 'T') === false ? 'Y-m-d H:i:s.uP' : 'Y-m-d\TH:i:s.uP'; $dateTime = \DateTime::createFromFormat($dateFormat, $dateAndTime . $microseconds . $timeZone, new \DateTimeZone('UTC')); return $dateTime ?: null; } }