Questions tagged [gettime]

Use for questions related to the 'gettime' method, for getting the time in JavaScript.

The getTime() method returns the numeric value corresponding to the time for the specified date according to universal time.

You can use this method to help assign a date and time to another Date object. This method is functionally equivalent to the valueOf() method.

Read more in the ref.

142 questions
-1
votes
1 answer

How to fix getting time in Safari for Javascript

When getting the time in Chrome and Firefox I get the number of milliseconds for a given date, but for Safari it Shows NaN. Any ideas why this would happen? I would need it to show also the number of milliseconds -as well- in Safari. PHP code $date…
Eduardo
  • 53
  • 8
-1
votes
3 answers

date.getTime() difference problem

Greetings, I have one simple condition that never passes: if(datas.date.getTime()-temps.date.getTime()>=5000) I want to check if it has been 5 seconds from one to another. Update: Here is setter and getter: public class Data{ Date date; …
Clark Kent
  • 11
  • 4
-1
votes
2 answers

Java Date getTime() method

I use getTime() method of Date class in java. when I perform it in my local it return an value different with when I perform it in other pc whereas date value is same. start.getTime()
Ali_Rezvani
  • 29
  • 2
  • 4
-1
votes
2 answers

How to forward declare clock_gettime()

I'm using clock_gettime() in cpp project. But it gives clock_gettime() not declared in this scope error. Clearly, someone else has already included time.h, hence this error is expected. But how do I forward declare clock_gettime()? I tried int…
bhushan23
  • 481
  • 1
  • 4
  • 13
-1
votes
4 answers

Constantly check time in Java

So I was digging around in some old java projects that I never finished and I pulled out this little number that is of my best projects ever built. It's a desktop clock widget coded in java and it works perfectly fine except for one thing. The way…
xR34P3Rx
  • 395
  • 9
  • 28
-2
votes
1 answer

set midnight in javascript for cookie expiration

Good morning, I currently have this script: now = new Date (). getTime (); now = now + 86400000; this takes the current date and time and adds 24 hours to it. Instead, I would need to set midnight of the current day. I tried with: var d = new Date…
Igor
  • 1
  • 1
-3
votes
2 answers

Convert User Input to Milliseconds?

I'm trying to figure out how to convert a User Input date to Milliseconds. These are the expected input types: var case1 = "2015-12-25"; var case2 = 1450137600; var case3 = "1450137600abcdefg"; It needs to accept either input type and convert it to…
Adam Weiler
  • 561
  • 6
  • 15
1 2 3
9
10