Ask Question

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

93 questions

271votes15answers600kviews

Format a datetime into a string with milliseconds

How can I format a datetime object as a string with milliseconds? user avatar Jurudocs

  • 7,545
33votes2answers46kviews

Java date parsing with microsecond or nanosecond accuracy

According to the SimpleDateFormat class documentation, Java does not support time granularity above milliseconds in its date patterns. So, a date string like 2015-05-09 00:10:23.999750900 // The ... user avatar PNS

  • 18.4k
139votes17answers309kviews

Getting date format m-d-Y H:i:s.u from milliseconds

I am trying to get a formatted date, including the microseconds from a UNIX timestamp specified in milliseconds. The only problem is I keep getting 000000, e.g. $milliseconds = 1375010774123; $d = ... user avatar slik

  • 4,759
385votes14answers486kviews

How to get milliseconds from LocalDateTime in Java 8

I am wondering if there is a way to get current milliseconds since 1-1-1970 (epoch) using the new LocalDate, LocalTime or LocalDateTime classes of Java 8. The known way is below: long ... user avatar Georgios Syngouroglou

  • 16.9k
100votes4answers167kviews

Timestamp with a millisecond precision: How to save them in MySQL

I have to develop a application using MySQL and I have to save values like "1412792828893" which represent a timestamp but with a precision of a millisecond. That is, the amount of milliseconds since ... user avatar Luixv

  • 8,230
93votes5answers104kviews

How do you specify the date format used when JAXB marshals xsd:dateTime?

When JAXB marshals a date object (XMLGregorianCalendar) into an xsd:dateTime element. How can you specify the format of the resulting XML? For example: The default data format uses milliseconds <... user avatar Young Fu

  • 1,217
123votes23answers219kviews

How to convert time in milliseconds to hours, min, sec format in JavaScript?

I have a time as a number of milliseconds and I want to convert it to a HH:MM:SS format. It should wrap around, with milliseconds = 86400000 I want to get 00:00:00. user avatar cheliyan

  • 1,559
17votes2answers28kviews

How can I get millisecond and microsecond-resolution timestamps in Python?

How do I get millisecond and microsecond-resolution timestamps in Python? I'd also like the Arduino-like delay() (which delays in milliseconds) and delayMicroseconds() functions. I read other answers ... user avatar Gabriel Staples

  • 22.4k
384votes16answers491kviews

How to get current time in milliseconds in PHP?

time() is in seconds - is there one in milliseconds? user avatar COMer

  • 4,761
5votes2answers15kviews

Do something every x (milli)seconds in pygame

I'm learing Python and Pygame, and my first thing I'm making is a simple Snake game. I'm trying to make it so that the snake moves once every 0.25 seconds. Here is the part of my code that loops: ... user avatar RedRocker227

  • 155
127votes17answers262kviews

Is there a stopwatch in Java?

Is there a stopwatch in Java? On Google I only found code of stopwatches that don't work - they always return 0 milliseconds. This code I found doesn't work and I don't see why. public class StopWatch ... user avatar user1007522

  • 7,496
95votes9answers258kviews

How to convert a string Date to long millseconds

I have a date inside a string, something like "12-December-2012". How can I convert this into milliseconds (long)? user avatar Dawood Ahmed

  • 1,672
268votes12answers481kviews

Get DateTime.Now with milliseconds precision

How can I exactly construct a time stamp of actual time with milliseconds precision? I need something like 16.4.2013 9:48:00:123. Is this possible? I have an application, where I sample values 10 ... user avatar LuckyHK

  • 2,691
54votes4answers113kviews

Get current time in milliseconds using C++ and Boost

In my thread (using boost::thread) I need to retrieve the current time in ms or less and to convert into ms: Actually, reading here I've found this: tick = boost::posix_time::second_clock::... user avatar ghiboz

  • 7,647
23votes7answers57kviews

Java - alternative to thread.sleep

I have a requirement to pause a while loop for a specific number of milliseconds. I have tried using Thread.sleep(duration) but it is not accurate, especially in a looping scenario. Millisecond ... user avatar user1189747

  • 231

153050per page

1 2 3 4 57