Forum Moderators: coopster
But getting visitor time is always possible by javascript as you know , but what you mean by showing data based on local time? Data shown will always be latest picked from database i guess even if sever and local visitor are in diff time zone
Can you give example what we want to do?
On a few trials I got what I wanted. May be it can be helpful to somebody else so I post it here:
<?php
//code
?>
<script type="text/javascript">
function GetTime() {
var now = new Date();
//var currenthour = now.getHours();
//var currenttime = now.getMinutes();
//var currentdate = now.getDate();
//var offset = now.getTimezoneOffset();
document.write(now);
}
</script>
<?php
$time_current = "<script language=javascript>GetTime();</script>";
echo "Time: ". $time_current;
?>
[edited by: Habtom at 5:38 am (utc) on July 19, 2007]