Posted By

Jaymoon on 10/02/08


Tagged

php time date dynamic


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

fackz
dantreacy


Show Current Date


 / Published in: PHP
 

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

  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  

You need to login to post a comment.