Class | Description |
---|---|
![]() |
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. |
![]() |
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. |
Example: 1999/12/31
Example: Friday, 20th July 2001
Example: 31/12/1999 23:59
Example: 31/12/1999
Example: 31/12/1999 23:59:59
Example: 23:59
Example: Sun 23:59
ISO 8601 Example: YYYYMMDDTHHMMSS-HHMM
Example: 1999-07-17 23:59:59
Example: Mar 3rd 1999
Example: Mar 3rd 1:30pm
Example: Mar 3rd
Example: Mar 3rd 1999 1:30pm
Example: 1:30pm
Example: 12-31-1999 23:59:59
Example: 1999-07-17 23:59:59
Example: Mar 3 21:30
Example: 12/31/1999 23:59:59
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