Questions tagged [milliseconds]

A millisecond is a thousandth (1/1,000) of a second.

660 questions
0
votes
0 answers

Python - what is the best way to turn a string date of format yyyy-mm-dd to UTC milliseconds since epoch?

I've tried numerous methods to get this working but I have no luck so far. I'm wondering if it has anything to do with the fact I am in the UK and python is looking at my local time. for instance I want to convert 2013-04-01 to 1364770800000. any…
Nazilla
  • 581
  • 1
  • 7
  • 17
0
votes
5 answers

how to convert milliseconds to Time of day?

I have three 'long' variables: start, end & testtime. long start = 1412801340000 //(means 10/8/14 4:49 PM in UTC time) long end= 1412808540000 //(means 10/8/14 6:49 PM in UTC time) long testtime = 1447195740000 //(means…
user1406716
  • 9,565
  • 22
  • 96
  • 151
0
votes
1 answer

Date and time converting to milliseconds

I want to change date from time and to time, To milliseconds. I written this code but while getting from json it's giving wrong date and time. I want to change date from time and to time, To milliseconds. | I written this code…
Arun
  • 142
  • 1
  • 1
  • 9
0
votes
1 answer

Unparseable date exception Creating a date from two objects

i'm using JXDatePicker and JSpinner to input date and time from the user. I then need to format it back to one date in a long millisecond format. with input of 03/09/2014 in JXDatePicker , the output from the JXDatePicker is: Wed Sep 03 00:00:00…
David Gidony
  • 1,243
  • 3
  • 16
  • 31
0
votes
0 answers

Is there any proper method to convert ISO8601(with tzone) to milliseconds on python?

Now I have a list of ISOformat strings, such as '2014-06-23T18:07:47.000Z'. In order for some computations, I need to convert them into milliseconds. Just like on Javascript, there is a built-in method Date.parse() which can take such an ISO string…
Maytree23
  • 125
  • 1
  • 10
0
votes
3 answers

Ignore milliseconds in TDateTime (Same TDateTime values subtracted are not 0)

my problem in short: TDateTime A (03.09.2014 13:40) - TDateTime B (03.09.2014 13:40) = -1 I have two TDateTime values which i want to compare, first i used the = operator to check if they are the same but after a few tests i realized that this is…
TryToSolveItSimple
  • 873
  • 1
  • 12
  • 23
0
votes
4 answers

How to calculate milliseconds with Java as in Ruby?

I can calculate the time in milliseconds with the following Ruby snippet: $ irb > require 'date' => true > Date.new(2014,9,5).to_time => 2014-09-05 00:00:00 +0200 > Date.new(2014,9,5).to_time.to_i * 1000 => 1409868000000 1409868000000 is the…
JJD
  • 50,076
  • 60
  • 203
  • 339
0
votes
2 answers

Date to milliseconds / milliseconds to date

I have a date in milliseconds. obtained with something like: SELECT EXTRACT(MILLISECONDS FROM NOW()) How do I revert to a date again? I've tried with: SELECT TO_TIMESTAMP(EXTRACT(MILLISECONDS FROM NOW())) The above returns a date in 1970 ...
Thom Thom Thom
  • 1,279
  • 1
  • 11
  • 21
0
votes
2 answers

How to get timestamp in milliseconds for two weeks back from the current date in C++?

I need to calculate timestamp in milliseconds for two weeks old date from the current date. As of now this is the way I am calculating current timestamp in milliseconds - struct timeval tp; gettimeofday(&tp, NULL); uint64_t current_ms = tp.tv_sec *…
john
  • 11,311
  • 40
  • 131
  • 251
0
votes
1 answer

sqlite convert Jdn to unixepoch

I have a column of date in jdn format. I want to migrate my date format from jdn to Java Calendar.getTimeInMillis() that is equal to sqlite unixepoch. here is sample migration code. ALTER TABLE TABLE_TIMES ADD COLUMN millies INTEGER UPDATE…
mrd abd
  • 828
  • 10
  • 19
0
votes
0 answers

How to sum or/and difference time in Minutes : Seconds : Milliseconds format in PHP

I need to calculate rally results table in PHP. So i have varchar string column in the mysql db in 'mm:ss:milliseconds' format ('03:54:78' for example). How can i do the ($time1 + $time2) and ($time1 - $time2) operations in PHP ?
Trimod
  • 114
  • 1
  • 5
0
votes
3 answers

convert String to date but i get today instead

I want to convert a given String from JSON in format "YYYY-MM-DD HH:MM:SS" to a Date so I can convert it to a Calendar and finally get mills from that Specific date and to day. but I just get Today instead of given date public static String…
Mahdi
  • 6,139
  • 9
  • 57
  • 109
0
votes
1 answer

pthread_cond_timedwait() not waiting under 1 second? (Linux)

I wrote that nice capability to listen to UDP messages and these are added to a FIFO whenever a new message arrives and that is signaled to a listener. The listener waits for messages if it has nothing else to do. However, it knows, in some cases,…
Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
0
votes
1 answer

Timestamp in milliseconds doesn't gets converted to hours, minutes and seconds properly?

Below is my simple timer class which is working fine in simplest cases. I am using below timer class to measure how much time certain code takes in getting executed. public static class StopTimer { public static StopTimer getInstance() { …
john
  • 11,311
  • 40
  • 131
  • 251
0
votes
4 answers

Java - Milliseconds to Month/Year (not just the current time)

Say I have an algorithm in Java where I want to do something on a monthly basis based off the time associated with each object. So for example, if Object a has time long t, and t is in milliseconds since the epoch, how would I find out that t is a…
user3475234
  • 1,503
  • 3
  • 22
  • 40