Get your current date and time in php, set your location default time zone get your current time zone.
manually set the timezone by using date_default_timezone_set before the date() or time().
ASIA Time
<?php date_default_timezone_set ("Asia/Calcutta"); $dateofreg1=date('m/d/Y h:i:s a', time()); echo "The current india timezone is: " . $dateofreg1; ?>
Australia Time zone
<?php date_default_timezone_set('Australia/Melbourne'); $dateofreg1=date('m/d/Y h:i:s a', time()); echo "The current india timezone is: " . $dateofreg1; ?>
America Time Zone
<?php date_default_timezone_set('America/New_York'); $dateofreg1=date('m/d/Y h:i:s a', time()); echo "The current india timezone is: " . $dateofreg1; ?>
No comments:
Post a Comment