Lines Matching full:date

12  * This class is responsible for parsing the several different date and time
48 …$date = new DateTimeImmutable($matches[1] . '-' . $matches[2] . '-' . $matches[3] . ' ' . $matches…
53 return $date;
58 * Parses an iCalendar (rfc5545) formatted date and returns a DateTimeImmutable object.
60 * @param string $date
65 static function parseDate($date, DateTimeZone $tz = null) { argument
68 $result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])$/', $date, $matches);
71 … throw new InvalidDataException('The supplied iCalendar date value is incorrect: ' . $date);
79 $date = new DateTimeImmutable($matches[1] . '-' . $matches[2] . '-' . $matches[3], $tz);
81 … throw new InvalidDataException('The supplied iCalendar date value is incorrect: ' . $date);
84 return $date;
198 * Parses either a Date or DateTime, or Duration value.
200 * @param string $date
205 static function parse($date, $referenceTz = null) { argument
207 if ($date[0] === 'P' || ($date[0] === '-' && $date[1] === 'P')) {
208 return self::parseDuration($date);
209 } elseif (strlen($date) === 8) {
210 return self::parseDate($date, $referenceTz);
212 return self::parseDateTime($date, $referenceTz);
218 * This method parses a vCard date and or time value.
220 * This can be used for the DATE, DATE-TIME, TIMESTAMP and
221 * DATE-AND-OR-TIME value.
226 * year, month, date, hour, minute, second, timezone
235 * List of date formats that are supported:
260 * A full basic-format date-time string looks like :
263 * A full extended-format date-time string looks like :
269 * @param string $date
273 static function parseVCardDateTime($date) { argument
276 (?: # date part
281 (?<date> [0-9]{2})?
298 if (!preg_match($regex, $date, $matches)) {
302 (?: # date part
305 (?<date> [0-9]{2})
323 if (!preg_match($regex, $date, $matches)) {
324 throw new InvalidDataException('Invalid vCard date-time string: ' . $date);
331 'date',
393 * @param string $date
397 static function parseVCardTime($date) { argument
413 if (!preg_match($regex, $date, $matches)) {
429 if (!preg_match($regex, $date, $matches)) {
430 throw new InvalidDataException('Invalid vCard time string: ' . $date);
459 * This method parses a vCard date and or time value.
461 * This can be used for the DATE, DATE-TIME and
462 * DATE-AND-OR-TIME value.
466 * year, month, date, hour, minute, second, timezone
474 * List of date formats that are supported:
491 * List of supported date-time formats:
505 * @param string $date
509 static function parseVCardDateAndOrTime($date) { argument
513 '(?<year>\d{4})(?<month>\d\d)(?<date>\d\d)' .
515 '|--(?<month>\d\d)(?<date>\d\d)?' .
516 '|---(?<date>\d\d)' .
537 // date-and-or-time is date | date-time | time
540 if (0 === preg_match($valueDate, $date, $matches)
541 && 0 === preg_match($valueDateTime, $date, $matches)
542 && 0 === preg_match($valueTime, $date, $matches)) {
543 throw new InvalidDataException('Invalid vCard date-time string: ' . $date);
549 'date' => null,
557 $parts['date0'] = &$parts['date'];
558 $parts['date1'] = &$parts['date'];
559 $parts['date2'] = &$parts['date'];