Ricard Nàcher Roig

Greenhorn
+ Follow
since Jan 20, 2016
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ricard Nàcher Roig

first of all thanks for your reply.

I was trying to notice that, in my opinion, the example is not the right one. I mean that if someone tell me that "2015-01-20T12:45:18.401" contains nanoseconds and there is no other example with nanoseconds, I would think that this is a mistake, although it gets explained in the following page. I would prefer to have also an example with nanoseconds, let's say "2015-01-20T12:45:18.401000123" just there and add some comment explaining the truncation process in that paragraph. Actually, I mean that I get confused while reading that part, I miss an example with nano-seconds or a note about output truncation.

best regards!
Ricard

regards.
In the book at page number 139, just above the square highlighted text, there is the following text:

"
2015-01-20
12:45:18.401
2015-01-20T12:45:18.401

The key is to notice the type of information in the output. The first one contains only a
date and no time. The second contains only a time and no date. This time displays hours,
minutes, seconds, and nanoseconds. The third contains both date and time. Java uses T to
separate the date and time when converting LocalDateTime to a String"

I think that time information show milliseconds rather than nanoseconds. Maybe the authors wanted to highlight that LocalTime has nanosecond precision.