/datetime-defs.php| Class | Description |
|---|---|
timeslot
|
Classes to handle a 24-hr time schedule. Covers the setting of * any number of slots, and testing whether a given time is in one of * the slots. The timeslot class. Holds details of a single slot. |
schedule
|
Classes to handle a 24-hr time schedule. Covers the setting of * any number of slots, and testing whether a given time is in one of * the slots. The schedule class. Holds multiple timeslots. |
BACKWARDS_DATE_ONLY = "Y/m/d"
(line 39)
Example: 1999/12/31
DAY_AND_DATE = "l, jS F Y"
(line 57)
Example: Friday, 20th July 2001
DISPLAY_DATE_FORMAT = "d/m/Y H:i"
(line 30)
Example: 31/12/1999 23:59
DISPLAY_DATE_ONLY = "d/m/Y"
(line 36)
Example: 31/12/1999
DISPLAY_TIMESTAMP_FORMAT = "d/m/Y H:i:s"
(line 33)
Example: 31/12/1999 23:59:59
DISPLAY_TIME_ONLY = "H:i"
(line 60)
Example: 23:59
DOW_HHMM = "D H:i"
(line 81)
Example: Sun 23:59
ISO_8601 = "Ymd\THisO"
(line 84)
ISO 8601 Example: YYYYMMDDTHHMMSS-HHMM
ISO_DATABASE_FORMAT = "Y-m-d H:i:s"
(line 72)
Example: 1999-07-17 23:59:59
NICE_DATE = "M jS Y"
(line 51)
Example: Mar 3rd 1999
NICE_DATETIME = "M jS g:ia"
(line 45)
Example: Mar 3rd 1:30pm
NICE_DATE_NOYEAR = "M jS"
(line 42)
Example: Mar 3rd
NICE_FULLDATETIME = "M jS Y g:ia"
(line 54)
Example: Mar 3rd 1999 1:30pm
NICE_TIME_ONLY = "g:ia"
(line 63)
Example: 1:30pm
POSTGRES_DATE_FORMAT = "m/d/Y H:i:s"
(line 66)
Example: 12-31-1999 23:59:59
POSTGRES_STD_FORMAT = "Y-m-d H:i:s"
(line 69)
Example: 1999-07-17 23:59:59
SHORT_DATETIME = "M j H:i"
(line 48)
Example: Mar 3 21:30
SQL_FORMAT = "m/d/Y H:i:s"
(line 78)
Example: 12/31/1999 23:59:59
STD_DMY = "d/m/Y"
(line 75)
Example: 23/5/2001
Conversion: datetime to descriptive Convert a database-compatible datetime string into a descriptive date/time format for the user display, using the given displayformat string.
Conversion: datetime to descriptive Returns a timestamp from a database-formatted datetime string.
We are assuming the datetime is formatted in the ISO format of "1999-07-17 23:59:59+12" - POSTGRES_STD_FORMAT (ISO) This is set up by the standard application via an SQL query with the "SET DATESTYLE ISO" command (see query-defs.php).
Day of Week now as string Returns the day name (eg. "Monday") as it is now.
Day of Month now as integer Returns the day of the month (1-31) as it is now.
Return the days in a month Given an integer month number 1-12, and an optional year (defaults to current) this function returns the number of days in the given month.
Conversion: descriptive to datetime without the time element.
Converts a descriptive date/time string into a database compatible 'date' field as per Postgres ISO spec.
Conversion: descriptive to datetime.
Converts a descriptive date/time string into a database compatible 'datetime' field as per Postgres ISO spec.
Conversion: descriptive to timestamp.
Converts a descriptive date/time string into a timestamp.
Format date as DD/MM/YYYY
Take a date string as entered in a form and reformat it to DD/MM/YYYY. Obviously it as to be more or less in this format to begin with, but we cope with a few foibles here like two-digit year, different delimiters and also strip off any time component added to the end.
Get date components of datetime string Returns the date components of a formatted date string.
We start by assuming DD/MM/YYYY ordering, but can alter this if it looks wrong. Note that the date string we are looking at must be in vaguely standard format, ie. with "/" or "-" or "." as delimiter etc. We return an array as: ["day"] - Day of month (1 - 31) ["month"] - Month number (1 - 12) ["year"] - Year eg. 1982
Get time components of datetime string Extract the HH:MM[:SS] from datetime string Returns the time components of a formatted date string.
We return an array as: ["hours"] - Hours (0 - 23) ["minutes"] - Minutes (0 - 59) ["seconds"] - Seconds (0 - 59)
Check if year is a leap year.
Determines whether the given year is a leap year.
Tell minutes difference between too datetimes Returns the minutes difference between the two given datetimes.
Month now as string Returns the month name (eg. "January") as it is now..
Return month number Return the number of the named month, default to Jan if problems arise.
Tell nice difference between too datetimes
Returns a nice expression of the difference between the two given datetimes written in a nice English sentence
Tell nice difference between too Unix timestamps
Returns a nice expression of the difference between the two given timestamps, written in a nice English sentence
Time now as array
Returns the current time as an associative array: ["hours"] - Hours since midnight ["minutes"] - Minute of the curent hour ["seconds"] - Seconds of the current minute
Time now as string
Returns the current time as a string 'hr:min:sec'
Conversion: timestamp to datetime.
Returns a string in the correct format for populating a database 'datetime' field, as per ISO 8601 spec.
Conversion: timestamp to descriptive Convert a Unix timestamp into a descriptive date/time format for the user display, using the given displayformat string.
Today as DD/MM/YYYY Returns the given datetime as a date, and in EUROPEAN 'd/m/Y' format.
Today as MM/DD/YYYY Returns the given datetime as a date, and in SQL 'm/d/Y' format.
Documentation generated by phpDocumentor 1.3.0RC3