1. <?php
  2. /**
  3.  * last_restart_date() Function
  4.  * Created by: Joshua H. (TRUSTAbyss)
  5.  *
  6.  * This function is very similar to the date function, but instead
  7.  * it will return the last restart date.
  8.  *
  9.  * Usage: last_restart_date(DATE_FORMAT, SECONDS_UPTIME)
  10.  * This function accepts one last argument as a boolean to see if it
  11.  * should display a GMT date or not.
  12.  */
  13.  
  14. function last_restart_date($date_format, $secs_uptime, $gmt = true)
  15. {
  16. if ($gmt) // The date is formatted for Greenwich Mean Time (Default).
  17. {
  18. return gmdate($date_format, time()-$secs_uptime);
  19. }
  20. else // The date is formatted for the server's local time.
  21. {
  22. return date($date_format, time()-$secs_uptime);
  23. }
  24. }
  25.  
  26. // Output the date and time when we restarted Abyss Web Server. A very useful function!
  27. echo '<b>Last Restart Date:</b> <br>'.last_restart_date('F d, Y @ h:i A', $_SERVER['X_ABYSS_STATS_HOST_CURRENT_UPTIME']);
  28. ?>