Kitty1911
Kitty1911

Reputation: 691

Java Date-Time format confusion

I have a date-time string like 2013-10-23 10:10:04.0. I'm kind of confused by what the extra zero signifies at the end of the string?

Does it denote the time zone or something else? I saw documentation on the different characters for the Java DateTime format, but I'm not sure what it is in the string above?

Upvotes: 0

Views: 110

Answers (3)

Vivin Paliath
Vivin Paliath

Reputation: 95558

It's milliseconds.

The format for the date is yyyy-MM-dd HH:mm:ss.S, where S is the millisecond.

So .002 would be two milliseconds and .200 would be two hundred milliseconds.

Upvotes: 2

Cristian Meneses
Cristian Meneses

Reputation: 4041

Ussually, the date time format is denoted by

yyyy-MM-dd HH:mm:ss.S where S (the last part of the format) are the milliseconds, in this case, .2 whould be 200 milliseconds.

Taje a look at SimpleDateFormat docs, and the patterns

Upvotes: 3

Jamil Seaidoun
Jamil Seaidoun

Reputation: 969

If I remember it's milliseconds

Upvotes: 2

Related Questions