UNB Components Code Reference

UnbDatabase::ConvertDateTime method

Converts a date/time value between PHP's UNIX timestamps and the SQL notation.

public static function UnbDatabase::ConvertDateTime ($in);

Parameters

in
(int) UNIX timestamp
(string) SQL notation in the format "YYYY-MM-DD HH:MM:SS" and UT timezone. Only a date like "YYYY-MM-DD" is also accepted.

Return value

the date/time in the respective other format. An input value of (int) 0 or (string) "0000-00-00 00:00:00" is both interpreted as "no value" and converted accordingly.

Exceptions thrown

InvalidArgumentException On unrecognised date/time format or invalid argument type.

Member of class: UnbDatabase

Implementation file: database.class.php, line 761

© 2010 Yves Goergen. UNB Components Homepage. Reference generated on 2010-03-07.