Get the Current Time


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



Copy this code and paste it in your HTML
  1. <?php
  2. $h = "8"; // Standard time zone for Hong Kong :UTC/GMT +8 hours
  3. $hm = $h * 60;
  4. $ms = $hm * 60;
  5. $localtime= gmdate("m/d/Y g:i:s A", time()+($ms));
  6. echo "Your current time now is : $localtime. ";
  7. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.