Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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.

return: void
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}

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

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

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

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

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

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

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

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