unix_to_human([$time = ''[, $seconds = FALSE[, $fmt = 'us']]])
Parameters: |
|
---|---|
Returns: |
Formatted date |
Return type: |
string |
Takes a UNIX timestamp as input and returns it in a human readable format with this prototype:
YYYY-MM-DD HH:MM:SS AM/PM
This can be useful if you need to display a date in a form field for submission.
The time can be formatted with or without seconds, and it can be set to European or US format. If only the timestamp is submitted it will return the time without seconds formatted for the U.S.
Examples:
$now = time(); echo unix_to_human($now); // U.S. time, no seconds echo unix_to_human($now, TRUE, 'us'); // U.S. time with seconds echo unix_to_human($now, TRUE, 'eu'); // Euro time with seconds
Please login to continue.