human_to_unix()

human_to_unix([$datestr = ''])

Parameters:
  • $datestr (int) – Date string
Returns:

UNIX timestamp or FALSE on failure

Return type:

int

The opposite of the unix_to_time() function. Takes a “human” time as input and returns it as a UNIX timestamp. This is useful if you accept “human” formatted dates submitted via a form. Returns boolean FALSE date string passed to it is not formatted as indicated above.

Example:

$now = time();
$human = unix_to_human($now);
$unix = human_to_unix($human);
doc_CodeIgniter
2016-10-15 16:32:26
Comments
Leave a Comment

Please login to continue.