Questions tagged [datetime-parsing]
423 questions
-1
votes
2 answers
How to parse date "2022-07-18T08:24:18Z" in android
I have tried these format but none worked.
yyyy-MM-dd'T'HH:mm:ss'Z'
yyyy-MM-dd'T'HH:mm:ssZ
yyyy-MM-dd'T'HH:mm:ssZZ
yyyy-MM-dd'T'HH:mm:ss
Also tried "ZonedDateTime", but it is not available below Android O.

Akanksha Paul
- 7
- 1
-1
votes
1 answer
How to parse date and time in android?
I am trying to parse date and time coming from the api. I am getting this kind of response "ArrivalTime":"\/Date(1543469400000)\/" .How to parse this response?

Suraj D
- 11
- 1
-1
votes
1 answer
java.time.format.DateTimeParseException: Text could not be parsed at index "dd.MM.yyyy HH:mm"
My code is:
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm");
String filterValue = "01.03.2021 0:01";
LocalDateTime parsedDate =…

Jens Kisters
- 117
- 2
- 10
-1
votes
5 answers
How to take Time Input in a line in Java?
The problem is for Java
I want to take time input as follows
12:00 AM 11:42 PM
There will be a sequence of such inputs up to N lines.
Here two different Time Inputs are given
1)12:00 AM
2)11:42 PM
but they are in the same line.
The time inputs…

Manav Sarkar
- 89
- 1
- 9
-1
votes
1 answer
How to convert time string to Date in Java? ParseException
The time string is like Tue Feb 09 10:23:31 CST 2021, how to convert to date object?
This is my code :
SimpleDateFormat dateFormat = new SimpleDateFormat("E M d hh:mm:ss z yyyy");
Date parsedDate = dateFormat.parse("Tue Feb 09 10:23:31 CST…

nick wu
- 139
- 1
- 5
- 17
-1
votes
4 answers
Easy way to generate SimpleDateFormat
I am having this string "Mon Nov 11 10:36:53 GMT+02:00 2019". What is the pattern when using SimpleDateFormat();? Is there some way I can test or generate it without multiple try and error?

Dim
- 4,527
- 15
- 80
- 139
-1
votes
1 answer
DateTimeParseException: Text '2019-06-07 12:18:16' could not be parsed
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("timestampString: " + timestampString);
Instant…

user468587
- 4,799
- 24
- 67
- 124
-1
votes
2 answers
How to set Z as timezone in SimpleDateFormat
Code sample:
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
System.out.println(dateFormat.getTimeZone());
System.out.println(dateFormat.parse(time));
// dateFormat.setTimeZone(TimeZone.getTimeZone("Asia/Kolkata"));
I…

Ankush Nakaskar
- 121
- 1
- 2
- 8
-1
votes
1 answer
Getting Wrong time after converting Server time to Local Time
I am receiving time from server in this format:
2018-04-04T08:41:21.265185Z
I have converted this time to local time. But after conversion the time I am getting time one hour more than the cctual current time.
This is code for time…

Satyam Gondhale
- 1,415
- 1
- 16
- 43
-1
votes
2 answers
Convert date into AEST using java
I want to convert below date into AEST format using Java.
2018-01-08T02:10:24.000+0000w
Below is the code which i am using for to convert .
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSzzz");
ZonedDateTime zdt =…

user1734980
- 45
- 2
- 11
-1
votes
2 answers
Regex to Capture next line Date/Time YYYY/MM/DD HH:mm or YYYY/M/D H:m
I want to capture Date format - yyyy/mm/dd hh:mm
[^\n\r]*[\r\n]+([12]\d{3}/(0[1-9]|1[0-2])/(0[1-9]|[12]\d|3[01]))**
The above expression captures the next line up to the day, but I want to include time part as well and would also like to…

Sidh Rg
- 3
- 1
- 7
-1
votes
2 answers
java.util.Date wrong parsing/formating on a specific day
I'm using java.util.Date. The expression:
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-10-16 00:00:00").toString()
is returning "Sun Oct 16 01:00:00 BRST 2016" (a wrong date) for this particular date, but a correct response on most other…

Leao
- 11
- 3
-1
votes
4 answers
Time Conversion 12H to 24H
I wrote this code to convert 12H time to 24H time but with an input:
07:05:45pm
I get output as:
07:05:45
Here's the code
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class…

Karan
- 11
- 1
- 5
-1
votes
1 answer
Can't convert ISO 8601 date to String in Android
I have an Android application that shows the creation date of a ticket with info I get from the server.
The thing is that I can't parse the string I'm getting I get an exception when I try to parse it with a SimpleDateFormat
This is what I get from…

Ranbeuer
- 167
- 3
- 12
-1
votes
1 answer
Quick way to execute parsing dates and put in a TreeMap
I have to read a massive csv with about 40.000 entries with dates and values. I did that :
TreeMap fi = new TreeMap();
CSVReader reader = new CSVReader(new FileReader(path),';');
String []…

Aikas
- 67
- 2
- 7