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
0
votes
1 answer

getTime( ) Javascript

I have a php date, and i want the difference about php date and today's date. The code is: function countdown(counter, year, month, day, hour, minute, second){ var datePhp = new Date(year, month, day, hour, minute, second); var…
mjosee7
  • 33
  • 5
0
votes
1 answer

Android trying to display GPS getTime() result is crashing the app

I'm building an Android app using GPS localization, and for that purpose I need first to display localization parameters like speed, time of last fix, deltatime, distance, an so on. No problem with speed, but as soon as I try to display the…
0
votes
1 answer

Getting Arizona time with getTime()

date= Calendar.getInstance(); Date currentDate = date.getTime(); String sDate = currentDate.toString(); This returns time EST. I need to change it to Arizona time which is tricky because Arizona does not have daylight savings time. Is there a…
Aaron
  • 4,380
  • 19
  • 85
  • 141
0
votes
1 answer

Timeval struct usage

I needed to calculate the time it takes to run a certain function and ran into the following code,record & output the execution time of a piece of code in nanoseconds And also is there any difference between struct timeval timer_spent & timeval…
Siva
  • 141
  • 1
  • 2
  • 12
0
votes
2 answers

Issue with timer function using get time function

I'm trying to use getTime to set a timer for an image gallery. When I add an alert during the else block of imageWait() this function works perfectly but without the alert nothing happens. Any ideas why? milliseconds=null; galleryLoop(); function…
Jesse
  • 3
  • 3
0
votes
1 answer

Can't use clock_gettime() in VxWorks RTP application

Here's the code which is built into a static user library call log.a. This builds fine. #include void logSomething() { .... struct timespec tp; clock_gettime(CLOCK_REALTIME, &tp); timeStamp = tp; //log some…
0
votes
1 answer

Native Client - how can I use GetTime?

I am fairly new to NaCl and trying to port a successful application from C++ Visual Stidio. I want to get the time and my code has the following statement: PP_Time mytime = PPB_Core::GetTime(); but the compiler does not like this giving the…
0
votes
1 answer

Converting a .getTime value for from date to Calender date of the format YYYY-MM-DD

I am trying to convert a .getTime date/value back to a format of the form YYY-MM-DD. Any help on this please? Currently I am populating my text From date with a value 2013-05-23. the .getTime value for this is 1371970800000 I then want to increment…
user1971376
  • 93
  • 1
  • 4
  • 10
0
votes
1 answer

creating an array of dates as milliseconds from select options as "YYYY, M, D"

I have a select menu with options looking something like this... I want to create an array of the dates from this menu but as milliseconds so I need something like: myArray = [1368140400000,...…
Tom
  • 12,776
  • 48
  • 145
  • 240
0
votes
1 answer

How to filter rows in database

I have a small line of code here... if(todaysDate!==date_encoded_time){ str +='
'+recipe_arr[x].recipe_name+''+'
'; }else { str +='
'+recipe_arr[x].recipe_name+'NEW…
ninpot18
  • 127
  • 1
  • 6
  • 16
0
votes
2 answers

Initializing a repetitive action with Javascript with getTime()

I'm a newb to development, so this may come off as a stupid question, but I figured I'd ask anyway. After all, me looking bad just makes you look better. :) I want to change the css style on an element based on time. I've tried a few different…
Dom Ramirez
  • 2,132
  • 2
  • 23
  • 29
-1
votes
1 answer

Time difference issue

function timeDifference(laterdate, earlierdate) { var difference = laterdate.getTime() - earlierdate.getTime(); var daysDifference = Math.floor(difference/1000/60/60/24); difference -= daysDifference*1000*60*60*24 var hoursDifference =…
-1
votes
3 answers

Get current time without methods

I am trying to do it without methods so that I can better grasp the concept. I am really close. My hours math seems to be off. What am I not understanding there? static void showCurrent(){ Date today = new Date(); long milliseconds =…
xtina_lt
  • 29
  • 6
-1
votes
1 answer

How can i get UTC +1 from React DatePicker?

I am using React DatePicker to get the date and time for a booking. Everything seems to work, i get the right date and it gets sent to the database but if i select let's say 10:30 as time, what i get to the database is 9:30, because apparently UTC…
Francesco
  • 549
  • 1
  • 8
  • 14
-1
votes
4 answers

JavaScript needed in determining seconds elapsed in current year starting Jan 01 at 00:00

I am newbee in JavaScript and i am having toughtime calculating seconds elapsed in current year not from 1970 as JavaScript default method calculates. Basically i need to develop script which will show countup timer of products produced in current…
1 2 3
9
10