zoneddatetime Questions

1

I am migrating an application from jdk 8 to 11 and I can see ZonedDateTime change is behavior about daylight saving time. JDK8 ZonedDateTime parse = ZonedDateTime.parse("2037-05-10T19:15:00.000+0...
Countershaft asked 22/5, 2019 at 10:43

2

Solved

I'm parsing a ZonedDateTime using like this: @JsonSerialize(using = ZonedDateTimeSerializer.class) private ZonedDateTime expirationDateTime; I need to be able to properly deserialize this date...
Rodent asked 20/7, 2017 at 11:42

3

Solved

I'm having trouble in formatting a string to a ZonedDateTime. My customer wants to have the date in a format such as ddMMyyyyhhmmss, with no separators or stuff like that. This is what I've d...
Mascia asked 28/3, 2019 at 10:9

3

While using util.date and giving date with time to service from browser and then saving to db and taking it back it gives different date time against setting zoneddatetime directly from service. An...
Queensland asked 27/2, 2019 at 17:43

2

Solved

We have a library used for generating reports. It reads from a data file (SQL, XML, JSON, etc.), the datetime may then be modified in a user written equation, and then it is formatted as specified ...
Judgeship asked 25/1, 2019 at 14:45

2

Solved

I have a flight itinerary program where I need to get difference between departure and arrival time. I get these specified times as String from the data. Here is my problem: import static java.tim...
Sibby asked 12/11, 2018 at 0:2

3

Solved

I have a Date object which holds a date (not current date) and I need to somehow specify that this date is UTC and then convert it to "Europe/Paris" which is +1 hours. public static LocalDateTime ...
Shrieval asked 8/11, 2018 at 9:49

2

Solved

I am using the ZonedDateTime with DateTimeFormatter of Java 8. When I try to parse my own pattern it doesn't recognizes and throws an exception. String oraceDt = "1970-01-01 00:00:00.0"; DateTim...
Cheroot asked 25/1, 2016 at 23:1

2

Solved

I am hoping to get some help debugging this problem. If I send the following JSON to my backend it works correctly: { "approvalRequired": false, "location": { "locationName": "<+37.33233141,...
Shaylashaylah asked 17/9, 2018 at 5:16

2

Solved

I want to deserialize date from Twitter to ZonedDateTime. My program fails on the created_at field deserializing. My Domain class @JsonIgnoreProperties(ignoreUnknown = true) public final class Tw...
Grief asked 20/8, 2018 at 15:59

3

Solved

Migrating Joda time to Java 8 Joda: UserObject user = new UserObject() user.setCreatedAt(new DateTime(rs.getTimestamp("columnName")));` Migrating to Java 8 This is my code; it does compile; I ...
Exclude asked 16/7, 2018 at 18:52

1

Solved

I have a datetime-string WITHOUT a specified timezone. But I want to parse it with ZonedDateTime to give it a timezone-meaning in the act of parsing. This code is working but uses LocalDateTime fo...
Oxblood asked 28/6, 2018 at 12:34

1

Solved

What I mean is this. Suppose I have a date object that is May 1, 2018, 12:00AM. I would like to create a ZonedDateTime object that is May 1, 2018, 12:00AM but of ANOTHER time zone (say EST). Becaus...
Aim asked 2/5, 2018 at 10:34

2

Solved

I have this code : ZonedDateTime t1 = ZonedDateTime.parse("2018-04-06T10:01:00.000+03:00"); ZonedDateTime t2 = ZonedDateTime.parse("2018-04-06T10:01:00.000-03:00"); System.out.println(t1.compareTo...
Deitz asked 6/4, 2018 at 5:55

2

Solved

I have this code that generates a date and time, ZoneId z = ZoneId.of( "Africa/Nairobi" ); Instant instant = Instant.now(); ZonedDateTime zdt = instant.atZone(z); return zdt.toString(); ...
Herv asked 19/3, 2018 at 6:45

3

Solved

I was comparing two dates which seem to be equal, but they contain a different name of zones: one is Etc/UTC, another is UTC. According to this question: Is there a difference between the UTC and...
Ynez asked 26/1, 2018 at 13:57

2

Solved

I have code, similar to this: import java.time._ object app { def main (args :Array[String]) = { println("app started") // create two ZonedDateTime objects for 1st Jan 2018, 10am UTC // usin...
Boffin asked 22/1, 2018 at 10:58

6

Solved

I am trying to write a generic method to return a ZonedDateTime given a date as String and its format. How do we make ZonedDateTime to use the default ZoneId if it is not specified in the date St...
Crucial asked 14/9, 2017 at 12:19

4

Solved

I am trying to ensure that calling toString() on my ZonedDateTime Object will comply with ISO-8601 format. The documentation for the toString() method states: ...The output is compatible with I...
Hovercraft asked 26/4, 2017 at 12:27

1

I am using Hibernate and JPA to store my data in a database. Now I would like to save a ZonedDateTime from java.time. The problem is, Hibernate does only ever persist the date and time. It does n...
Temper asked 14/8, 2017 at 13:30

2

Solved

I am struggling with mentioned in the question issue. I need to create some custom deserializer which is more or less type conversion from the standard deserializer (reason is that ZonedDateTime i...
Vacation asked 5/7, 2017 at 5:58

2

Solved

ZonedDateTime zdt = ZonedDateTime.of(2015, 10, 18, 0, 30, 0, 0, ZoneId.of("America/Sao_Paulo")); System.out.println(zdt); // 2015-10-18T01:30-02:00[America/Sao_Paulo] You can see the hour is 1 ...
Grindlay asked 26/6, 2017 at 8:3

2

I try to convert string from JSON to ZonedDateTime just like static String getWatchTime(JSONObject aJson, JSONObject bJson) { long difference = 0 ; try { String aTime = aJson.getString("time_ut...
Scary asked 11/6, 2017 at 18:4

1

Solved

I have a model object where I want to have a field with a date. For now I am using ZonedDateTime as it fits our needs. Hibernate stores this field in the database as a tinyblob. Can we change the ...
Coryza asked 10/5, 2017 at 15:49

1

Solved

I'm intended to use epoch millisecond for the deserialization and serialization. However only the deserialzation works but failed to serialize back to the correct ZonedDateTime. ObjectMapper mappe...
Coronach asked 2/5, 2017 at 5:51

© 2022 - 2024 — McMap. All rights reserved.