Skip to main content
4 votes
1 answer
577 views

DateTimeFormatter Java 8 introduced a modern date and time API with new types like LocalDate available in java.time.* package. It also provided a new DateTimeFormatter class for formatting (generating ...
Mahozad's user avatar
  • 26.4k
-1 votes
1 answer
163 views

I'm updating my code to use java.time.format.DateTimeFormatter instead of java.text.SimpleDateFormat and now a test fails which didn't before. When I parse the String 2010-12-31 00:00:00 , which in my ...
Loris's user avatar
  • 9
1 vote
0 answers
40 views

I'm using Windows.Globalization.DateTimeFormatting.DateTimeFormatter in a UWP app with the culture set to "en-US". I noticed inconsistent formatting between two similar patterns. Scenario: ...
HEMAPRIYA G's user avatar
4 votes
3 answers
203 views

Both of these DateTimeFormatters are nearly identical, however only the second one throws an exception. Both of these patterns are valid as far as I can tell. Why does changing minWidth cause parsing ...
Steven's user avatar
  • 2,612
-3 votes
2 answers
184 views

DateTimeFormatter fails on valid Instants. How it is meant to format those below and above LocalDateTime.MIN and LocalDateTime.MAX? Manually? DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"...
Brethlosze's user avatar
  • 1,647
1 vote
1 answer
92 views

Is DateTimeFormatter missing ofYearMonth() method? It has ofLocalizedDateTime() ofLocalizedDate() ofLocalizedTime() If using ofPattern(), it is not locale sensitive.
eastwater's user avatar
  • 5,808
2 votes
1 answer
244 views

I want to express periods in the day, such as in the morning, in the afternoon, or at night, not just AM or PM. Is there any pattern in java.time API to format and parse periods in a day, such as in ...
Arvind Kumar Avinash's user avatar
0 votes
1 answer
86 views

DateTime Formatter shows (GMT-8:00) instead of PST Date date = new Date(2024,11,23); ZoneId zone = ZoneId.of("US/Pacific"); DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("...
sunil kumar's user avatar
0 votes
1 answer
65 views

I have an index in Elasticsearch that needs to take datetime formats in the following variations: 08/23/2023 8:00:00 PM(UTC+0) 2023-08-23T20:00:00+0000 I can't get an Elasticsearch mapping for the ...
Lupzoh's user avatar
  • 11
5 votes
1 answer
508 views

I am currently working with Java's DateTimeFormatter to parse ISO 8601 formatted timestamps, particularly those containing fractional seconds. While experimenting with different timestamp formats, I ...
Ayush Jain's user avatar
2 votes
1 answer
111 views

I have a Java 8 application that has to accept any number of date and time formats from a user. Obviously that yields an exhaustive list, as there are many ways to write a date and time. For locale ...
S Hornby's user avatar
  • 115
-3 votes
1 answer
116 views

I am trying to convert current date and time with the help of LocalDateTime java class and then trying to store it in Database table column having Date datatype. Below is the code , i am trying to ...
Rahul.V's user avatar
2 votes
0 answers
158 views

DateTimeFormatter formatters = DateTimeFormatter.ofPattern("uuuu-MM-dd"); endDate = LocalDate.parse(endDateString, formatters); Why does the above code not throw exceptions for leap years? ...
Mazin Ismail's user avatar
2 votes
1 answer
122 views

I've been looking around but can't find any example usage of offset O in the timestamp schema as described in https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html. From ...
stackoverflowflowflwofjlw's user avatar
-1 votes
2 answers
149 views

I know this has been asked before, but I still have an error after looking at all the solutions. I'm trying to parse a String to a LocalDateTime using a DateTimeFormatter. This is my code: import java....
Tony Valderrama's user avatar

15 30 50 per page
1
2 3 4 5
14