3

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
  • 171
  • 1
  • 5
  • 18

2 Answers2

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

etc

Mudassir Ali
  • 7,503
  • 3
  • 30
  • 59
2

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

var currentTime = new Date();
jonvuri
  • 5,496
  • 1
  • 22
  • 32