Getting client computers local time

  • Thread starter Thread starter Andy B
  • Start date Start date
A

Andy B

How do you show the client computers local time on a page even if the page
is hosted in a totally different timezone?
 
How do you show the client computers local time on a page even if the page
is hosted in a totally different timezone?

using client (java)script

<script type="text/javascript">
var t= new Date();
alert(t);
</script>
 
Is there a way of doing this so mobile devices can show it?

<div>
   <script type="text/javascript">
       document.write(Date());
   </script>
</div>
Google for JavaScript date / time formatting options...

There are mobiles which do not support JavaScript. You would need to
prompt user to choose the time zone. Take a look at the following
thread for more details: http://forums.asp.net/p/1090269/1646091.aspx

Hope this helps
 
Back
Top