Skip to content

Instantly share code, notes, and snippets.

@fjarrett
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fjarrett/83c2698ea83ca7381ff8 to your computer and use it in GitHub Desktop.
Save fjarrett/83c2698ea83ca7381ff8 to your computer and use it in GitHub Desktop.
Testing the output of PHP microtime()
<?php
echo '<h1>Current Time</h1>';
$microtime = microtime( true );
printf( '<p><strong>Unix epoch microtime:</strong> %s</p>', $microtime );
printf( '<p><strong>GMT/UTC timezeone:</strong> %s</p>', date( 'Y-m-d H:i:s', $microtime ) );
date_default_timezone_set( 'America/Chicago' ); // Enter your timezone string here
printf( '<p><strong>My timezeone:</strong> %s</p>', date( 'Y-m-d H:i:s', $microtime ) );
die();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment