[PHP] simpletimes function

/ Published in: PHP
Save to your folder(s)

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

Copy this code and paste it in your HTML
  1. define('DATE_FORMAT', 'Y-m-d H:i:s');
  2. function simpletimes() {
  3. $time['timestamp'] = time();
  4. $time['micro_time'] = microtime();
  5. $time['date_time'] = date(DATE_FORMAT,$time['timestamp']);
  6. $time['unix_time'] = strtotime($time['date_time']);
  7. $time['hash_time'] = md5($time['unix_time']);
  8. return $time;
  9. }

URL: snipplr.com/simpletimes

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.