Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.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