1
Sikandar
Current Client Date and time?
  • 2009/12/13 4:11

  • Sikandar

  • Just popping in

  • Posts: 99

  • Since: 2005/5/19


Hi All,
Is there any way I can display current date and time of client not of server.

thanks

2
ghia
Re: Current Client Date and time?
  • 2009/12/13 8:56

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


You have to use a little JavaScript in your theme to do that.

3
culex
Re: Current Client Date and time?
  • 2009/12/14 10:23

  • culex

  • Module Developer

  • Posts: 711

  • Since: 2004/9/23


You can use something like this in your theme
<script language="javascript">
        
// Set vars date, hour, minutes
        
var currentTime = new Date()
        var 
hours currentTime.getHours()
        var 
minutes currentTime.getMinutes()
    
// if less than 10 add a preceeding zero to the minute
    
if (minutes 10)
        
minutes "0" minutes
        
// print the time
            
document.write("The time is now : " hours ":" minutes " ");
script>
Ups didnt see Ghias link. His example is better :)

Login

Who's Online

311 user(s) are online (236 user(s) are browsing Support Forums)


Members: 0


Guests: 311


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits