Skip to content

Instantly share code, notes, and snippets.

@mikestratton
Last active August 29, 2015 14:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mikestratton/50b40ba80f3a57b9eaea to your computer and use it in GitHub Desktop.
Unix Time Stamp
<?php
$unix = new DateTime(); //Unix Time Stamp (seconds since Jan 01 1970. (UTC))
$unix_ts = $unix->getTimestamp();
$now = $unix_ts - 1420070400; //seconds between Unix Time Stamp and Jan 1 2015(UTC)
$y_sui_tot = $now / 766.385574378; //suicide occurs every 766 seconds
$f_sui = number_format($y_sui_tot);
echo "<h1>Total Suicides in 2015: <br/>".$f_sui."</h1>";
$y_sui_att = 25 * $y_sui_tot; // 25 suicide attempts before fatality
$f_att = number_format($y_sui_att);
echo "<h1>Suicide Attempts in 2015: <br/>".$f_att."</h1>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment