P4A_DateDate/Time Class.
Library for standard date operations like formatting/unformatting.
Some parts of the code are based on PEAR::Date and PEAR::Date_Calc packages at {link http://pear.php.net/package-info.php?package=Date}, modified for p4a necessity.
Located in /p4a/libraries/date.php (line 48)
string
get_weekday_name
([string $year = NULL], [string $month = NULL], [string $day = NULL], [array $locale_vars = NULL])
string
get_weekday_short_name
([string $year = NULL], [string $month = NULL], [string $day = NULL], [array $locale_vars = NULL])
string
unformat
(string $date, string $format, [string $output_format = P4A_DATETIME], [array $locale_vars = NULL])
date_to_days (line 675)
Converts a date to number of days since a distant unspecified epoch.
days_to_date (line 716)
Converts number of days to a distant unspecified epoch.
day_of_week (line 559)
Returns day of week for given date, 0=Sunday
format (line 95)
Date pretty printing, similar to strftime()
Formats the date in the given format, much like strftime(). Most strftime() options are supported.
formatting options:
%a abbreviated weekday name (Sun, Mon, Tue)
%A full weekday name (Sunday, Monday, Tuesday)
%b abbreviated month name (Jan, Feb, Mar)
%B full month name (January, February, March)
%C century number (the year divided by 100 and truncated to an integer, range 00 to 99)
%d day of month (range 01 to 31)
%D same as "%m/%d/%y"
%e day of month, single digit (range 0 to 31)
%E number of days since unspecified epoch (integer, Date_Calc::dateToDays())
%H hour as decimal number (00 to 23)
%I hour as decimal number on 12-hour clock (01 to 12)
%j day of year (range 001 to 366)
%m month as decimal number (range 01 to 12)
%M minute as a decimal number (00 to 59)
%n newline character (\n)
%O dst-corrected timezone offset expressed as "+/-HH:MM"
%o raw timezone offset expressed as "+/-HH:MM"
%p either 'am' or 'pm' depending on the time
%P either 'AM' or 'PM' depending on the time
%r time in am/pm notation, same as "%I:%M:%S %p"
%R time in 24-hour notation, same as "%H:%M"
%S seconds as a decimal number (00 to 59)
%t tab character (\t)
%T current time, same as "%H:%M:%S"
%w weekday as decimal (0 = Sunday)
%U week number of current year, first sunday as first week
%y year as decimal (range 00 to 99)
%Y year as decimal including century (range 0000 to 9999)
%% literal '%'
get_months_names (line 657)
Returns an array of month names Used to take advantage of the setlocale function to return language specific month names.
get_month_name (line 623)
Returns the full month name for the given month
get_month_short_name (line 646)
Returns the abbreviated month name for the given month
get_weekdays_names (line 608)
Returns an array of week days
Used to take advantage of the setlocale function to return language specific week days
get_weekday_name (line 540)
Returns the full weekday name for the given date
get_weekday_short_name (line 525)
Returns the abbreviated weekday name for the given date
gregorian_to_iso (line 835)
Converts from Gregorian Year-Month-Day to ISO YearNumber-WeekNumber-WeekDay Uses ISO 8601 definitions.
Algorithm from Rick McCarty, 1999 at http://personal.ecu.edu/mccartyr/ISOwdALG.txt. Transcribed to PHP by Jesus M. Castagnetto
is_future_date (line 912)
Determines if given date is a future date from now.
is_leap_year (line 789)
Returns true for a leap year, else false
is_past_date (line 941)
Determines if given date is a past date from now.
is_valid_date (line 502)
Returns true for valid date, false for invalid date.
julian_date (line 755)
Returns number of days since 31 December of year before given date.
now (line 596)
Returns the current local date. NOTE: This function retrieves the local date using strftime(), which may or may not be 32-bit safe on your system.
parse (line 445)
Parses a date in the standard datetime format and returns an associative array with every single date part.
unformat (line 243)
Reverse date analysis on a formatted date.
This function takes the formatted date and the original format and try to get it back in standard datetime format.
week_of_year (line 814)
Returns week of the year, first Sunday is first day of first week
Documentation generated on Mon, 07 Jan 2008 11:29:15 +0100 by phpDocumentor 1.4.0