<?php
include("includes/connection.php");//connection file to database
$ip=$_SERVER['REMOTE_ADDR'];
echo "<b>IP Address= $ip</b>";
echo "<br />";
$date=gmdate("F j, Y, g:i a", strtotime("+5 hours 30 minutes")); // Modify this to ur local time i.e((GMT) +5hours) or what ever ur local time changes with respect to GMT
echo gmdate("F j, Y, g:i a", strtotime("+5 hours 30 minutes"));
$query="INSERT INTO ipaddress (ipaddress,date) values('$ip','$date')";
mysql_query($query,$connection);
mysql_close($connection)
?>