4

Possible Duplicate:
How to get current date in JavaScript

How can i Get the time out of my browser whit using javascript? This do I need to make a comparison in my script.

Community
  • 1
  • 1
Raymond van Os
  • 191
  • 1
  • 5
  • 18

2 Answers2

8
currentTime = new Date();
time = currentTime.getTime();
hours = currentTime.getHours();

etc

Mudassir Ali
  • 7,913
  • 4
  • 32
  • 60
2

You can use the Date object to get the current time:

var currentTime = new Date();
jonvuri
  • 5,738
  • 3
  • 24
  • 32