Return to Snippet

Revision: 56252
at March 17, 2012 17:18 by visionlighter


Initial Code
define('DATE_FORMAT', 'Y-m-d H:i:s');
function simpletimes() {
	$time['timestamp'] = time();
	$time['micro_time'] = microtime();
	$time['date_time'] = date(DATE_FORMAT,$time['timestamp']);
	$time['unix_time'] = strtotime($time['date_time']);
	$time['hash_time'] = md5($time['unix_time']);
	return $time;
}

Initial URL
snipplr.com/simpletimes

Initial Description
A useful function for different formats of time or if you are dealing with time in PHP code.

Initial Title
[PHP] simpletimes function

Initial Tags
php

Initial Language
PHP