Pg: 345
Status: Fixed
Fixed in Build: 19
Reported On: 2019-05-23
Reported By: Username987654
|
Location: 12.3.2 Creating a Date/Time object using the static parse methods
Old Text: You need to be aware of three such variables -
ISO DATE, ISO TIME, and ISO DATE TIME - because when you don’t pass a formatter to the parse
methods, these are the formatters that the parse methods use internally to parse the string. Lo-
calDate uses ISO DATE, LocalTime uses ISO TIME, and LocalDateTime uses ISO LOCAL DATE TIME
to parse the given string. Thus, for example, invoking LocalDate.parse("2018-02-14");
will produce the same result as invoking LocalDate.parse("2018-02-14", DateTimeFormat-
ter.ISO DATE);
New Text: You need to be aware of three such variables -
ISO_LOCAL_DATE, ISO_LOCAL_TIME, and ISO_LOCAL_DATE_TIME - because when you don’t pass a formatter to the parse
methods, these are the formatters that the parse methods use internally to parse the string. Lo-
calDate uses ISO_LOCAL_DATE, LocalTime uses ISO_LOCAL_TIME, and LocalDateTime uses ISO_LOCAL_DATE_TIME
to parse the given string. Thus, for example, invoking LocalDate.parse("2018-02-14");
will produce the same result as invoking LocalDate.parse("2018-02-14", DateTimeFormat-
ter.ISO_LOCAL_DATE);
Comments: The default formatters use the "local" versions. So, ISO_DATE should changed to ISO_LOCAL_DATE and so on.
|