Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

LICENSE This file is part of CFPropertyList.

Author: Rodney Rehm <rodney.rehm@medialize.de>
Author: Christian Kruse <cjk@wwwtech.de>
Copyright: Copyright © 2018 Teclib
License: MIT
File Size: 145 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

CFDate:: (6 methods):
  __construct()
  setValue()
  getValue()
  toXML()
  toBinary()
  dateValue()


Class: CFDate  - X-Ref

Date Type of CFPropertyList
Note: CFDate uses Unix timestamp (epoch) to store dates internally

__construct($value, $format = CFDate::TIMESTAMP_UNIX)   X-Ref
Create new Date CFType.

param: integer $value timestamp to set
param: integer $format format the timestamp is specified in, use {@link TIMESTAMP_APPLE} or {@link TIMESTAMP_UNIX}, defaults to {@link TIMESTAMP_APPLE}

setValue($value, $format = CFDate::TIMESTAMP_UNIX)   X-Ref
Set the Date CFType's value.

param: integer $value timestamp to set
param: integer $format format the timestamp is specified in, use {@link TIMESTAMP_APPLE} or {@link TIMESTAMP_UNIX}, defaults to {@link TIMESTAMP_UNIX}
return: void

getValue($format = CFDate::TIMESTAMP_UNIX)   X-Ref
Get the Date CFType's value.

param: integer $format format the timestamp is specified in, use {@link TIMESTAMP_APPLE} or {@link TIMESTAMP_UNIX}, defaults to {@link TIMESTAMP_UNIX}
return: integer Unix timestamp

toXML(DOMDocument $doc, $nodeName = "")   X-Ref
Get XML-Node.

param: DOMDocument $doc DOMDocument to create DOMNode in
param: string $nodeName For compatibility reasons; just ignore it
return: DOMNode &lt;date&gt;-Element

toBinary(CFBinaryPropertyList &$bplist)   X-Ref
convert value to binary representation

param: CFBinaryPropertyList The binary property list object
return: The offset in the object table

dateValue($val)   X-Ref
Create a UNIX timestamp from a PList date string

param: string $val The date string (e.g. "2009-05-13T20:23:43Z")
return: integer The UNIX timestamp