Show Current Date


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

For a complete list of time/date parameters, visit: http://php.net/manual/function.date.php


Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. // Value of how many hours offset from server and local time
  4. $hourdiff = "3";
  5.  
  6. // Offsetting time by seconds
  7. $timeadjust = ($hourdiff * 3600);
  8.  
  9. // Format of date which will be displayed
  10. $currentdate = date("l m/d/y",time() - $timeadjust);
  11.  
  12. // Display the output
  13. print ("$currentdate");
  14.  
  15. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.