Jeff PHP framework  0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
dtime Class Reference

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

Detailed Description

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:

  • %Y: 4 digits year
  • %m: 2 digits month
  • %d: 2 digits day
  • %H: 2 digits hour
  • %i: 2 digits minute
  • %s: 2 digits second
  • %F: full month name (January, ..., December)
  • %M: 3 digits month name (Jan, ..., Dec)
  • %D: 3 digits day name (Mon, ..., Sun)
  • %y: 2 digits year
  • %U: Unix Timestamp
Author:
abidibo abidi.nosp@m.bo@g.nosp@m.mail..nosp@m.com
Version:
0.99
Date:
2011-2012

Definition at line 45 of file dtime.class.php.


Constructor & Destructor Documentation

dtime::__construct ( registry)

Constructs a dtime instance.

Returns:
dtime instance

Definition at line 64 of file dtime.class.php.


Member Function Documentation

dtime::applyFormat ( matches) [private]

Returns the date or time value corresponding to the special character.

Parameters:
mixed$matchesThe special character matching
Returns:
the date or time value

Definition at line 144 of file dtime.class.php.

dtime::now ( format = null)

Returns the current time.

Parameters:
string$formatthe format of the outputted date string
Returns:
the current time in the requested format

Definition at line 76 of file dtime.class.php.

+ Here is the call graph for this function:

dtime::parseFormat ( format) [private]

Parses the format given by replacing special characters to date values and time.

Parameters:
mixed$formatthe format of the outputted date string
Returns:
the time string requested format

Definition at line 111 of file dtime.class.php.

+ Here is the caller graph for this function:

dtime::view ( date,
format = null 
)

Returns the given time in a custom format.

Parameters:
mixed$datedate to convert to the given format
mixed$formatthe format of the outputted date string
Returns:
the time string requested format

Definition at line 95 of file dtime.class.php.

+ Here is the call graph for this function:


Field Documentation

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.


The documentation for this class was generated from the following file: