jsr310 Questions

5

Solved

I know that: Instant is rather a "technical" timestamp representation (nanoseconds) for computing. LocalDateTime is rather date/clock representation including time-zones for humans. Sti...
Tampere asked 7/9, 2015 at 11:25

17

Solved

I use Spring Boot and included jackson-datatype-jsr310 with Maven: <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</...
Perutz asked 27/10, 2016 at 0:46

1

I have added the JavaTimeModule but still not able to get OffsetDateTime working on getting some data from RethinkDB @Configuration public class JacksonOffsetDateTimeMapper{ @Bean @Primary public O...
Obeng asked 17/2, 2022 at 9:5

4

Solved

I am using spring-boot 1.2.1.RELEASE with jackson 2.6.2 including the jsr310 datatype. I am using the annotation @SpringBootApplication to kick off my Spring app. I have spring.jackson.serializat...
Squab asked 5/10, 2015 at 15:27

5

Solved

I've the following field in a class I use during deserialization of a service that I'm consuming. private ZonedDateTime transactionDateTime; The service I'm consuming may return a Date or DateTi...
Uncleanly asked 13/1, 2016 at 10:34

5

Solved

I'm using ThreeTen-Backport library for my Android project (because java.time is not yet implemented in android development). When I write LocalDate today=LocalDate.now(); or LocalTime time=Local...
Disclose asked 9/7, 2016 at 12:29

3

Solved

LocalDate in Java has two similar methods equals and isEqual. What's the difference between them? When do they output different results?
Carpophore asked 22/5, 2021 at 9:1

7

Solved

I have a LocalDate variable called date, when I print it displays 1988-05-05 I need to convert this to be printed as 05.May 1988. How to do this?
Diagonal asked 27/1, 2015 at 18:21

2

Solved

I have a question with regards to the question Time dependent unit tests Let's say I build Spring application which contains service interface and its implementation If I want to change clock in ...
Sonia asked 2/5, 2017 at 13:19

2

Solved

Problem: Native queries with Spring Data returning dates return java.sql.Date not java.time.LocalDate, despite the setup. Context: A new project with Spring Boot 2.0.0.M5 (the latest), Hibernate ...

2

Solved

I'm doing a little PoC using jersey client to consume a REST service and I'm having problems with a field that is in LocalDateTime format. The REST service response is like this: { "id": 12, "i...
Halves asked 8/9, 2015 at 7:9

2

Solved

Why does java.time.Clock has zone information? From the Clock you only can get an Instant when calling the instant() method - which is a time without zone info. Is the only purpose to have the zon...
Belding asked 28/11, 2018 at 10:59

1

Solved

I have a model class that has a field: @JsonDeserialize(using = InstantDeserializer.class) @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ") private OffsetDateTime offsetDt; When a ...
Softhearted asked 9/11, 2018 at 20:3

3

Solved

I'm trying to marshal response containing ISO formatted timestamp like that: { ... "time" : "2014-07-02T04:00:00.000000Z" ... } into ZonedDateTime field in my domain model object. Eventually it...
Abacist asked 26/2, 2017 at 11:54

1

Solved

I am currently working on an Android Studio project with a minimum API version of 17 (JellyBean), so I cannot use the java.time package. Instead, I am using the ThreeTen backport for Android (com.j...
Pandect asked 7/7, 2018 at 12:27

2

I'm making a serivce client for a REST endpoint, using a JAX-RS client for the HTTP requests and Jackson to (de)serialize JSON entities. In order to handle JSR-310 (Java8) date/time objects I added...
Calie asked 22/9, 2017 at 10:50

3

Solved

JSR-310 has a handy class DateTimeFormatter which allows you to construct a DateTimeFormatter. I particularly like the pattern(String) method - see javadoc However, I hit a problem whereby this is ...
Worm asked 29/5, 2012 at 10:59

1

Solved

It seems that the new java.time API offers everything from java.util.Date and much more. Is there any reason to use java.util.Date when the newer java.time API is there since Java 8? Should java.ut...
Polyandrous asked 8/2, 2018 at 15:11

1

Solved

I'm looking for a solution to calculate the months between two date. I think joda or java8 time can do it. But when I compare them I found something really weird. import java.text.ParseException;...
Perni asked 15/9, 2017 at 5:47

3

Solved

I'm using the library described the Jackson Datatype JSR310 page but I'm still having difficulty getting it to work. I have configured the following bean: @Bean @Primary public ObjectMapper objec...
Nitid asked 10/4, 2015 at 22:24

3

Solved

I am writing new project in Java 8 in company. I have suggested to use Java 8 date time API but one of my co workers says that new Date time API works slow. Is it true? Also I want to get some off...
Hemingway asked 11/7, 2017 at 11:11

2

Solved

Does jOOQ provide support for JSR310 in combination with PostgreSQL? In particular, I am trying to use the following classes: java.time.Instant java.time.LocalDate java.time.LocalTime java.time.L...
Cushiony asked 31/7, 2015 at 14:14

1

Solved

I tried following code to use javax.time in Kotlin: import javax.time.calendar.LocalDate fun main(args: Array<String>){ println("Today is ${LocalDate.now()}"); } And got compilation erro...
Pleasantry asked 20/7, 2016 at 18:13

2

Methods such is ChronoUnit.HOURS.between(start, end) returns long so I can't get the fraction from there. Is there an alternative method/approach that would return a fraction?
Escapism asked 13/6, 2016 at 9:9

3

Solved

If I already have a date's month, day, and year as integers, what's the best way to use them to create a LocalDate object? I found this post String to LocalDate , but it starts with a String repres...
Trabue asked 15/3, 2015 at 15:12

© 2022 - 2024 — McMap. All rights reserved.