English
Getting started Documentation Download Contact Discussions
Documentation
Warning!

The English version of the documentation has so far only been translated using machine translator service. We are working on proofreading, the work is in progress.

Please be patient. Thank you!

Working with date and time - Jet\Data_DateTime

PHP itself has a great DataTime class. This is fully used by Jet and the Jet\Data_DateTime class directly inherits from the PHP class \DateTime - so it can do exactly the same thing and is fully integrated into the Jet platform and is used, for example, in the Jet DataModel ORM . The great PHP class \DataTime is only minimally extended, but further extensions cannot be ruled out in the future (while maintaining compatibility).

Method Význam
public static now(
) : static
Creates an instance and immediately sets the current date and time
public setOnlyDate(
bool $only_date
) : void
Sets whether the object represents only a date.
public isOnlyDate(
) : bool
Indicates whether the object represents only a date.
public toString(
) : string
Converts the date and time to a string in ISO format Ymd\TH:i:s, or Ymd if the object represents only a date.

This is useful, for example, when saving time data in a database or other storage.
public __toString(
) : string
The object can be directly converted to a string. This calls the toString method.
Previous chapter
Working with an array - Jet\Data_Array
Next chapter
Working with images - Jet\Data_Image