add_leading_zero();
Add leading zero to mon and mday.
ONO::Lib::DateTime::ToolBox->add_leading_zero( );
returns: ($mon,$mday)
birthday();
Select birthday, subroutine, see birthday_select().
ONO::Lib::DateTime::ToolBox->birthday( $birthday, $year, $BLK_ref );
returns: ($date_y,$date_m,$date_d)
birthday_select();
Select birthday.
ONO::Lib::DateTime::ToolBox->birthday_select( $name, $birthday, $year, $lang, $BLK_ref );
returns: $BIRTHDAY
check_zeros();
Check zeroes.
-Z remove zeroes.
ONO::Lib::DateTime::ToolBox->check_zeros( );
returns: $time
convert();
Convert time formats
$lang only required for -m switch
-3 shorter month name (3 chars)
-d dashes (yyyymmdd option)
-m month name ("date" target only)
-s slashes instead of periods
-S US only: slashes instead of periods
-u US time format
-U US time format detected on lang = en
-w add whitespaces
-Z eleminate zeros
Target = "classic" : from 1285128905(10) to yyyymmddhhmmss(14) Target = "yyyymmdd" : from 1285128905(10) to yyyymmdd or yyyy-mm-dd (-d) Target = "yymmdd" : from 1285128905(10) to yyyymmdd or yy-mm-dd (-d) Target = "unix" : from yyyymmddhhmmss(14) to 1285128905(10) Target = "slash" : from yyyymmdd to yyyy/mm/dd Target = "date" : from yyyymmdd to dd.mm.yyyy Target = "datetime" : from yyyymmddhhmmss(14) to dd.mm.yyyy hh:mm Target = "datetimesecs" : from yyyymmddhhmmss(14) to dd.mm.yyyy hh:mm:ss Target = "datetimereverse" : from dd/mm/yyyy \@ hh:mm:ss to yyyymmddhhmmss Target = "time" / 6 : from hhmm to hh:mm Target = "time" / 4 : Target = "time" / 3 : Target = "daymonyear" : from yyyymmdd to dd. Month yyyy
ONO::Lib::DateTime::ToolBox->convert( $target, $timestamp, $switches, $lang );
convert_hhmmss2ss();
Convert hhmmss to seconds
ONO::Lib::DateTime::ToolBox->convert_hhmmss2ss( );
returns: $time
convert_ss2hhmmss();
Convert seconds to hhmmss
ONO::Lib::DateTime::ToolBox->convert_ss2hhmmss( );
day_name();
Return day name.
-a all names
-m monday is zero
-s short (3 chars)
-S short (2 chars)
-u uppercase first
ONO::Lib::DateTime::ToolBox->day_name( );
get();
Get date and / or time, including some conversion options
A - no absolute time in -i mode b - important stuff gets bold d - date format EU (dd/mm/yyyy) D - date format US (mm/dd/yyyy) g - important stuff gets green i - intelligent mode features human readable output L - remove leading zeroes (unless it's midnight) m - display time if date is current date M - short 3 letter month name n - round up to full minute (no seconds displayed in intelligent mode) N - in intelligent mode o - last online r - short (dd. month) R - short with optional year (dd. month yyyy if not current year) s - stamp format 1 (dd/mm/yyyy \@ hh:mm) S - stamp format 2 (yyyymmdd) u - uppercase (first letter) y - year z - ? Z - remove non-required zeroes
ONO::Lib::DateTime::ToolBox->get( $inputtime, $timeoffset, $options, $lang );
logic2secs();
Convert m/h/d string to seconds
ONO::Lib::DateTime::ToolBox->logic2secs( );
returns: $secs
max_days_per_month();
Return the max number of days per month, note that Feb is 29 days here.
ONO::Lib::DateTime::ToolBox->max_days_per_month( );
returns: ( '31','29','31', '30','31','30', '31','31','30', '31','30','31' )
mmm2mm();
Convert month (3-char) to number (2-char).
ONO::Lib::DateTime::ToolBox->mmm2mm( );
month_name();
Return month name,
-3 abbreviated (3 chars)
-a ???
-j ???
-u ???
ONO::Lib::DateTime::ToolBox->month_name( $month, $switches, $lang );
nextdays();
This returns the exact date of an upcoming next day (example: what's the date of next friday?).
ONO::Lib::DateTime::ToolBox->nextdays( $year,$mon,$mday, $weekday, $target );
returns: "$year$mon$mday"
num();
Return year, mon ot mday
ONO::Lib::DateTime::ToolBox->num( );
schoolyear();
Return schoolyear.
ONO::Lib::DateTime::ToolBox->schoolyear( );
secs_hhmmss();
Convert secs to hhmmss.
ONO::Lib::DateTime::ToolBox->secs_hhmmss( );
secs_in_day();
Return 60*60*24
ONO::Lib::DateTime::ToolBox->secs_in_day( );
returns: 60*60*24
secs_in_hour();
Return 60*60
ONO::Lib::DateTime::ToolBox->secs_in_hour( );
returns: 60*60
secs_in_min();
Return 60
ONO::Lib::DateTime::ToolBox->secs_in_min( );
returns: 60
secs_in_month();
Return 60*60*24*31
ONO::Lib::DateTime::ToolBox->secs_in_month( );
returns: 60*60*24*31
secs_in_week();
Return 60*60*24*7
ONO::Lib::DateTime::ToolBox->secs_in_week( );
returns: 60*60*24*7
select_date();
Date selector.
$from and $to format: YYYY $default format: YYYYMMDD
-C compact (zero padding)
-d disabled
-E force use EU format
-j no jquery loading (prevent double loading, required for plupload compatibility for example)
-J no javascript loading (only if -P is used)
-m use month names
-n null is allowed
-P picker, make sure to use select_date_saver then
-r reverse years
-t today
-T add table code
-U force use US format
ONO::Lib::DateTime::ToolBox->select_date( $name, $from, $to, $default, $lang, $flags );
returns: $DATE
select_date_save();
Old version, used until Oct 2019, doesn't support date picker, better use select_date_saver() instead.
ONO::Lib::DateTime::ToolBox->select_date_save( $yyyy, $mm, $dd );
returns: $date
select_date_saver();
ONO::Lib::DateTime::ToolBox->select_date_saver( $name, $vars_ref );
returns: $date
string();
Return yyyymmddhhmmss string, which may be abbreviated (default = 8 chars).
ONO::Lib::DateTime::ToolBox->string( );
returns: substr("$year$mon$mday$hour$min$sec",0,$num)
timestamp();
Get UNIX time.
ONO::Lib::DateTime::ToolBox->timestamp( );
returns: time()
today();
Return yyyymmdd.
ONO::Lib::DateTime::ToolBox->today( );
returns: &string("",8)
today_std();
Return today.
-d include day name
-m month name
ONO::Lib::DateTime::ToolBox->today_std( );
returns: $DATE
todayhh();
Return yyyymmddhh.
ONO::Lib::DateTime::ToolBox->todayhh( );
returns: &string("",10)
tomorrow();
Return tomorrow's date. See also yesterday().
ONO::Lib::DateTime::ToolBox->tomorrow( $year,$mon,$mday );
returns: "$year$mon$mday"
yesterday();
Return yesterday's date. See also tomorrow().
ONO::Lib::DateTime::ToolBox->yesterday( $year,$mon,$mday );
returns: "$year$mon$mday"