Jeff PHP framework
0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
|
Class for the management of date and time strings. More...
Public Member Functions | |
__construct ($registry) | |
Constructs a dtime instance. | |
now ($format=null) | |
Returns the current time. | |
view ($date, $format=null) | |
Returns the given time in a custom format. | |
Private Member Functions | |
applyFormat ($matches) | |
Returns the date or time value corresponding to the special character. | |
parseFormat ($format) | |
Parses the format given by replacing special characters to date values and time. | |
Private Attributes | |
$_datetime | |
php datetime instance | |
$_settings | |
datetimeSettings instance |
Class for the management of date and time strings.
This class allows you to convert date and time in different formats and centralizes the management of the date and time formats.
The formats that can be used are those stored on the database through the datetimeSettings module, or customized formats, similar to what happens to the class datetime of php.
Here are the format characters supported:
Definition at line 45 of file dtime.class.php.
dtime::__construct | ( | $ | registry | ) |
dtime::applyFormat | ( | $ | matches | ) | [private] |
Returns the date or time value corresponding to the special character.
mixed | $matches | The special character matching |
Definition at line 144 of file dtime.class.php.
dtime::now | ( | $ | format = null | ) |
Returns the current time.
string | $format | the format of the outputted date string |
Definition at line 76 of file dtime.class.php.
dtime::parseFormat | ( | $ | format | ) | [private] |
Parses the format given by replacing special characters to date values and time.
mixed | $format | the format of the outputted date string |
Definition at line 111 of file dtime.class.php.
dtime::view | ( | $ | date, |
$ | format = null |
||
) |
Returns the given time in a custom format.
mixed | $date | date to convert to the given format |
mixed | $format | the format of the outputted date string |
Definition at line 95 of file dtime.class.php.
dtime::$_datetime [private] |
php datetime instance
Definition at line 57 of file dtime.class.php.
dtime::$_settings [private] |
datetimeSettings instance
Model tied to the database table which stores the date and time settings
Definition at line 52 of file dtime.class.php.