Lines Matching full:date
14 * This class is responsible for parsing the several different date and time
46 …$date = new DateTime($matches[1] . '-' . $matches[2] . '-' . $matches[3] . ' ' . $matches[4] . ':'…
49 // $date->setTimeZone(new \DateTimeZone('UTC'));
50 return $date;
55 * Parses an iCalendar (rfc5545) formatted date and returns a DateTime object.
57 * @param string $date
61 static public function parseDate($date, DateTimeZone $tz = null) { argument
64 $result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])$/',$date,$matches);
67 throw new LogicException('The supplied iCalendar date value is incorrect: ' . $date);
74 $date = new DateTime($matches[1] . '-' . $matches[2] . '-' . $matches[3], $tz);
75 return $date;
175 * Parses either a Date or DateTime, or Duration value.
177 * @param string $date
181 static public function parse($date, $referenceTz = null) { argument
183 if ($date[0]==='P' || ($date[0]==='-' && $date[1]==='P')) {
184 return self::parseDuration($date);
185 } elseif (strlen($date)===8) {
186 return self::parseDate($date, $referenceTz);
188 return self::parseDateTime($date, $referenceTz);
194 * This method parses a vCard date and or time value.
196 * This can be used for the DATE, DATE-TIME, TIMESTAMP and
197 * DATE-AND-OR-TIME value.
202 * year, month, date, hour, minute, second, timezone
211 * List of date formats that are supported:
236 * A full basic-format date-time string looks like :
239 * A full extended-format date-time string looks like :
245 * @param string $date
248 static public function parseVCardDateTime($date) { argument
251 (?: # date part
256 (?P<date> [0-9]{2})?
273 if (!preg_match($regex, $date, $matches)) {
277 (?: # date part
280 (?P<date> [0-9]{2})
298 if (!preg_match($regex, $date, $matches)) {
299 throw new InvalidArgumentException('Invalid vCard date-time string: ' . $date);
306 'date',
368 * @param string $date
371 static public function parseVCardTime($date) { argument
387 if (!preg_match($regex, $date, $matches)) {
403 if (!preg_match($regex, $date, $matches)) {
404 throw new InvalidArgumentException('Invalid vCard time string: ' . $date);