Date and Time Converter by Elac v0.9.3 elacdude@gmail.com www.elacdude.com
You are free to use this code free of charge, modify it, and distrubute it, just leave this comment block at the top of this file.
Changes/Modifications
6/24/08 - Version 0.9.2 released. Minor additions
- Added "S" support. (th, rd, st, nd. example: 5th)
- Added a few more abbreviations for units of time in calculate() (s. sec. secs. min. mins. m. and more)
- Added example.php (php examples and usage) and date_time_formats.html (list of supported date/time formats) to the package.
6/25/08 - Version 0.9.3 released. Bug fixes
- Fixed month subtraction (wrap to previous year) bug
- Fixed month and year "$only_return_the_value=true" bug. If you calculated by months or years, and set
$only_return_the_value=true, it would overwrite the values instead of just returning them.
- Fixed the "D" (Sun, Mon, Tue) bug. If you supplied "D" and "d" in the same mask, it would not return the correct output.
- Changed the names of public variables "day", "month", and "year" added "s" at the end for consistency purposes
11/14/08 - Version 0.9.4 released. Bug fix
- Got rid of the _one_dig_num function and used ltrim($num "0") instead
package | Default |
---|
__construct( $sDate, $sFormat)
ie: ("1152008", "njY") wont work; ("1/15/2008", "n/j/2008") will work. Example: $obj = new Date_Time_Calc('12/30/2008 17:40:00', 'm/d/Y H:i:s');
__destruct()
_default_date_time_units()
_month_num( $themonth, $return_two_digit = false)
Example: _month_num("jan"); //returns '1' Example2: _month_num("january", true); //returns '01'
convert( $new_mask, $save = true)
set_date_time( $start_date_time, $mask)
Example: $obj->set_date_time('11/20/2005 07:40:00 AM', 'm/d/Y H:i:s A');
date_time_stamp :mixed
var |
---|
mixed
date_time :string
var |
---|
string
date_time_mask :string
var |
---|
string
seconds :
minutes :
hours :
days :
months :
years :
ampm :