Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
13 replies
182 views

I am trying to replace Joda datetime and interval methods with Java.time and also trying to specify explicitly timezone as Duser.timezone=America/Chicago. This my code fragment public void ...
madhu's user avatar
  • 139
2 votes
0 answers
81 views

I have a spring boot webapp, which uses thymeleaf for html templating and as templating engine for emails sent by this webapp, too. In my email I want to use a LocalDateTime, which does not work. ...
dietzi96's user avatar
  • 133
4 votes
1 answer
589 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.5k
9 votes
7 answers
1k views

I need to iterate through the whole hours of an interval of a particular day. So given the time at one whole hour on the day in question, say, 01:00, how do I find the next whole hour? The next whole ...
Anonymous's user avatar
  • 87.6k
-1 votes
3 answers
200 views

I'm currently migrating my codebase from Joda-Time to the java.time API (Java 8+). In one part of my application, I schedule tasks to run at a specific time either today or tomorrow, depending on ...
dragon4's user avatar
  • 11
2 votes
4 answers
243 views

In Java, I can easily truncate a temporal value (LocalTime, ZonedDateTime, etc.) to seconds, milliseconds, or any other value that has an existing ChronoUnit defined: LocalTime time = LocalTime.now(); ...
M. Justin's user avatar
  • 23.5k
0 votes
1 answer
130 views

I am working on replacing crnk with Spring Hateos Json APi . I was getting a exception for LocalDateTime so I have used @JsonSerialize(using = LocalDateTimeSerializer.class) @JsonDeserialize(using =...
Thejas's user avatar
  • 527
-1 votes
1 answer
169 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
4 votes
3 answers
223 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
6 votes
4 answers
234 views

I am trying to parse durationString= P10YT10M using java.time.Duration.parse() method, but it fails with "Text cannot be parsed to a Duration". try { String durationString = "...
Vaibhav R's user avatar
0 votes
0 answers
27 views

I have been struggling to get my crossTab to group by "Month Year". I read that SimpleDateFormat is outdated. My dataset is using language domain. The coding is html style and lots of ...
Edward's user avatar
  • 896
5 votes
1 answer
192 views

I have a string: String inputDate = "18-FEB-24 10.02.33.578000000 AM"; I am trying to read it back and format it in YYYY-MM-DD HH:mm:ss.SSSSSS. I tried the SimpleDateFormat as well as ...
malife89's user avatar
-4 votes
2 answers
453 views

I have this Joda-Time date which I want to migrate to java.time.OffsetDateTime: import org.joda.time.DateTime; private DateTime createdDate; private String creationTime; ..... DateTimeFormatter dtf = ...
Peter Penzov's user avatar
0 votes
0 answers
42 views

I am converting a JSON to an object and it's giving me the following error: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type java.time.LocalDateTime not supported ...
smukh's user avatar
  • 99
0 votes
1 answer
320 views

I have this java code: import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import java.util.Date; DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormat....
Peter Penzov's user avatar

15 30 50 per page
1
2 3 4 5
138