datetime-parsing Questions

2

Solved

I am trying to convert string value "2018-10-11T12:00:00Z"; to ZonedDateTime. If I use the default ZonedDateTime.parse(zonedDateTime) then ss portion i.e. 00 is removed and I get "2018-10-11T12:00Z...

2

Solved

Question I want to parse a date-time given as string (UTC) into seconds since epoch. Example (see EpochConverter): 2019-01-15 10:00:00 -> 1547546400 Problem The straightforward solution, ...
Ootid asked 1/8, 2019 at 7:55

1

Solved

I have following code to convert an Instant to String then convert it back to I String timestampString = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss")); LOGGER.info...
Analyse asked 7/6, 2019 at 19:49

2

Solved

I have some legacy KML documents which includes a time stamp entry. Why is the below date not valid when using Instant to parse? Both methods are suppose to parse ISO 8601 formatted dates. String ...
Umbrage asked 22/3, 2019 at 16:41

4

Solved

Consider a historic date string of format: Thu Jan 9 12:35:34 2014 I want to parse such a string into some kind of C++ date representation, then calculate the amount of time that has passed sinc...
Rainbow asked 9/1, 2014 at 13:18

3

Solved

I am trying to port some code from joda time to java time. JodaTime had the possibility to specify a fallback value for the year like this parser.withDefaultYear((new DateTime(DateTimeZone.UTC))....
Subtle asked 13/4, 2018 at 7:56

1

I'm getting a request parameter with unknown temporal (date, time or timestamp in ISO format) and want to parse it into a java.time.temporal.TemporalAccessor: LocalDate when the string represents...
Alasdair asked 28/2, 2018 at 10:11

1

Solved

I am struggling with Java 8 DateTimeFormatter. I would like to convert a given String to dateFormat and parse to LocalDateTime Here is my code DateTimeFormatter f = DateTimeFormatter.ofPattern("...
Wamsley asked 16/2, 2018 at 0:20

1

I'm trying to convert a string into a LocalDateTime object. @Test public void testDateFormat() { String date = "20171205014657111"; DateTimeFormatter formatter = DateTimeFormatter.ofPatt...
Cyanic asked 5/12, 2017 at 2:18

1

Solved

Suppose I have a date such as: Nov 30, 2013 19:00:00.001930000 Eastern Standard Time I'm trying to parse the input using DateTimeFormatterBuilder, but I can't figure out what to put for the Se...
Pachston asked 20/10, 2017 at 2:52

4

Solved

We try to parse the following ISO 8601 DateTime String with timezone offset: final String input = "2022-03-17T23:00:00.000+0000"; OffsetDateTime.parse(input); LocalDateTime.parse(input, Dat...
Backbone asked 29/9, 2017 at 10:57

2

Solved

My application should be able to parse date ignoring timezone (I always know for sure that it is UTC). The problem is that the date might come in both following forms - 2017-09-11T12:44:07.793Z 0...
Eartha asked 25/9, 2017 at 17:10

2

Solved

I'm porting an existing application from Joda-Time to Java 8 java.time. I ran into a problem where parsing a date/time string that contains a 'day of week' value triggered an exception in my unit ...

9

Solved

Does anyone know how to parse date string in required format dd.mm.yyyy?
Shipmate asked 16/10, 2009 at 8:14

1

Solved

I have a model which has a timestamp property: class Model { @JsonProperty("timestamp") private OffsetDateTime timestamp; } The format of the timestamp is as following: 2017-09-17 13:45:42.71...
Haileyhailfellowwellmet asked 17/9, 2017 at 11:54

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

3

Solved

As an input I have a string which is a String in ISO 8601 to represent date. For example: "2017-04-04T09:00:00-08:00" The last part of String, which is "-08:00" denotes TimeZone Offset. I conv...
Licht asked 5/9, 2017 at 14:15

3

Solved

Why does this test pass, while the month value is obviously invalid (13)? @Test public void test() { String format = "uuuuMM"; String value = "201713"; DateTimeFormatter.ofPattern(format).wi...
Thickwitted asked 23/8, 2017 at 12:12

1

Solved

I'm trying to parse timestamps from a data source that is defined as using RFC1123-compatible date time specifications. My code is: value = Instant.from (DateTimeFormatter.RFC_1123_DATE_TIME.parse...
Fredi asked 23/8, 2017 at 2:42

1

I have a problem in convert time coming from server and I want to convert it to 24 hour. I'm using the following code: String timeComeFromServer = "3:30 PM"; SimpleDateFormat date12Format = new S...
Jalap asked 13/8, 2017 at 14:4

2

Solved

I am trying to create a DateTimeformatter to validate following date times: String date1 = "2017-07-06T17:25:28"; String date2 = "2017-07-06T17:25:28.1"; String date3 = "2017-07-06T17:25:28.12"; S...
Delacourt asked 6/7, 2017 at 13:40

1

Solved

My datetime has to come from frontend with timezone offset: 2017-07-04T06:00:00.000+01:00 I cannot deserialize it with Jackson. The error is: Text '2017-07-04T06:00:00.000+01:00' could not be p...
Materiel asked 4/7, 2017 at 20:25

4

Solved

I am trying to write a DateTimeFormatter that will allow me to take in multiple different String formats, and then convert the String formats to a specific type. Due to the scope of the project and...

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

4

Solved

I have a trouble with parsing date time in java, I have a strange date time format. How can I parse 2013-04-03T17:04:39.9430000+03:00 date time in java to format dd.MM.yyyy HH:mm in java?
Antilles asked 2/5, 2013 at 11:14

© 2022 - 2024 — McMap. All rights reserved.