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
vote
2 answers

Using getTime to calculate multiple Dates with If Else statements

I am working in Adobe Acrobat DC on a fillable PDF form and new to JavaScript. I need the value to be $100 until 9/21/2018, then from 9/22 - 10/19 to be $125 and then beginning on 10/20 to be $150. I have the script below which works for the first…
Darlhouse
  • 13
  • 5
1
vote
1 answer

react js blueprintjs Date Range Picker not work

I need create DateRangePicker on BlueprintJS(documentation) and RangePicker in my component, like in this screenshot. I instalation all npm packages, and do all by instructions: import { DateRangePicker } from…
1
vote
2 answers

js - Stop after 1 hour

I was creating a program which should stop automatically a . So please tell me how, here is a little bit I am thinking off: var time = date.getTime(); var seconds = 0; if (time + seconds == date.getTime()) { // Stop everything i do by myself…
modifyer
  • 67
  • 1
  • 2
  • 7
1
vote
1 answer

Saving gettime to form field

I'm a relative JS newbie, but I'm in a bit of a pickle - for a form submission system, I need to populate a form field with a unique ID (can be anything, as long as it's relatively certain to be unique). I thought of using getTime(), since that…
Bob Balm
  • 11
  • 2
1
vote
0 answers

clock_gettime is precision is only ms

I'm running QNX on a microcontroller board with a 25MHz clock speed. Running clock_gettime(CLOCK_REALTIME, &tp); gives me only a precision of ms. I'm aware that a precion of ns is not possible because of the low clock speed but us should be…
Schafwolle
  • 501
  • 3
  • 15
1
vote
3 answers

Android Location getTime to hours

I have a location object to which I'm assigning the result of the getLastKnownLocation() method. Now I need to know the age of these coordinates, in order to set a reasonable time frame in which I can update the latitude and longitude. I'm using…
ayyyeee
  • 323
  • 1
  • 2
  • 6
1
vote
0 answers

clock_gettime CLOCK_REALTIME unexpected result

I am trying to see how long it takes for a pipeline to process data, I store the result of clock_gettime (CLOCK_REALTIME, &start); when I add the data item to my input buffer. Then I use that time when I calculate how long it too took to process…
TechAUmNu
  • 152
  • 1
  • 3
  • 11
1
vote
1 answer

Calendar to Date issue, period with 1 year error

this is my first time asking, I couldn't find explanation in all internet, so here you go: I'm writing a simple function to calculate the date that was x days ago, so I wrote this code that was working very ok, until today, the calculated past date…
RionCrane
  • 21
  • 5
1
vote
1 answer

a gettime() function that returns a uint16_t value in C

Hi I'm trying to do a getTime() function that returns uint16_t in C. I do can successfully get an array of chars now Here's my code for a output of array of chars. Say today is Dec 9 2014 the output will be 091214 So how can i make the output a…
Shanji
  • 15
  • 4
1
vote
3 answers

How to convert date received from getTime() method to DD-MM-YYYY format?

My problem is simple yet so hard for me to solve. Basically I am storing the number received from the new Date().getTime() method in the database and then using that string in a time ago function. The function works very well but I don't know how to…
Dev Man
  • 2,114
  • 3
  • 23
  • 38
1
vote
1 answer

JAVA - getTime() from DB - always getting 01:00:00

I have this code for selecting time from my database (SQLite): String sql = "select cas from mytable where id = 'S222'"; Statement stmt2; try { stmt2 = con.createStatement(); ResultSet rs = stmt2.executeQuery(sql); …
user3556159
  • 87
  • 2
  • 7
1
vote
1 answer

Javascript new date(str).getTime() not working for IST

I am getting the time stamp from a server in following format "Wed Jan 15 14:17:06 PST 2014" or "Wed Jan 15 14:17:06 IST 2014" when I am doing getTime on second timestamp having IST I am getting NaN . Please take a look below: when I do: …
druveen
  • 1,611
  • 3
  • 15
  • 32
1
vote
5 answers

Generate month in character from calendar java into a variable

Good day all, I was trying to create a date variable by using Calendar java, the following is my example code: long day = System.currentTimeMillis(); Calendar cal = Calendar.getInstance(); java.text.SimpleDateFormat month = new…
Panadol Chong
  • 1,793
  • 13
  • 54
  • 119
1
vote
0 answers

How get getTime and battery level In my graph?

I'm working to create a chart of battery usage.. I'm using GraphViews library and i'm studing how it works. Right now in the original example code there is this part: exampleSeries1.resetData(new GraphViewData[] { new GraphViewData(0,…
David_D
  • 1,404
  • 4
  • 31
  • 65
1
vote
1 answer

how to get new location in google places in iphone?

sir i am new to iPhone development. i need to know how to get new location without sending latitude and langtitude in the url request. NSURL *URL = [NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search …
user1731387