Questions tagged [datetime-parsing]

423 questions
-2
votes
1 answer

Java: How to parse time in the format `YYYYMMDDHHMMSSTTT`?

I am trying to read rows of a csv file. Each row represents a log history with timestamp at column 1. The timestamp is always in the form of YYYYMMDDHHMMSSTTT (to the millisecond). However, I do not know how to parse time in the format of…
user1769197
  • 2,132
  • 5
  • 18
  • 32
-2
votes
1 answer

not able to convert String "rejectedDate":"2018-03-29" to ZoneDate time format

java.time.format.DateTimeParseException: Text '2018-03-29 16:15:30' could not be parsed at index 10 DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd"); OffsetDateTime date = …
-2
votes
1 answer

Parsing from SimpleDateFormat to Date not working?

SimpleDateFormat df = new SimpleDateFormat(); Date lastLogin = null; try { String troubleChild = lineScanner.next(); lastLogin = df.parse(troubleChild); } catch (ParseException e) { System.out.println("ohnoes"); } Hi I'm quite new to…
-2
votes
1 answer

How to parse time stamp with GMT in string to date format?

How to parse the following timestamp in string formate to date formate. Mon Sep 25 13:40:56 GMT+05:30 2017 Since it has GMT in the timestamp so I didn't find a valid answer for this. Please let me know how to write SimpleDateFormat for this?
Seenu69
  • 1,041
  • 2
  • 15
  • 33
-2
votes
3 answers

Converting String of different timezone to date of different timezone

I have had look to answers mentioned already but they don't tackle the problem I am facing. I have a String in GMT as: 2017-10-03T19:45:00.000+0000 Which I need to parse as any other time zone. The problem is those +0000. When I try to parse it…
-2
votes
3 answers

I have a string date format 01/01/2017 6:54 PM and want to convert it to 2017-01-01T00:00:05.383+0100 ISOFormat in scala

def cleantz( time : String ) : String = { var sign_builder= new StringBuilder ++= time println(sign_builder) var clean_sign = "" if (sign_builder.charAt(23).toString == "-"){ clean_sign=…
Joyce obi
  • 59
  • 1
  • 11
-2
votes
2 answers

Is this Date a valid one in Java?

Is this 00/00/00 a valid Date which is in MM/dd/yy format in Java? I have tried this below sample code to see if the 00/00/00 is a valid one in Java. But, the date which is getting parsed is SUN Nov 30 00:00:00 IST 2. public static void…
-2
votes
2 answers

How to solve the error convert String date from xml file to an int format?

I also find myself facing the date problem today, I extracted the date from an xml file in string format but when I try to convert it into an int format I have an error. This is a part of my code : DocumentBuilder dBuilder =…
celia
  • 29
  • 1
  • 7
-2
votes
1 answer

c# DateTime.ParseExact error

I have a String was not recognized as a valid DateTime error. Followed one of the examples from here. Which has an example that says: dateString = "15/06/2008 08:30"; format = "g"; provider = new CultureInfo("fr-FR"); try { result =…
bbusdriver
  • 1,577
  • 3
  • 26
  • 58
-3
votes
1 answer

Unparseable date: "Thursday 01 March 2018 12:43:38 PM IST"

I am getting a parse exception when inserting "Thursday 01 March 2018 12:43:38 PM IST" into MySQL as a timestamp. How can I convert this string for insertion into a MySQL timestamp column?
-3
votes
4 answers

Setting current date from ISO 8601 in object Calendar format using Java

Im trying to set the Calendar date object in the following way, but I don't know how. public void setTradeDate(String tradeDate) { Calendar tradeDate = ? } The String is in the format: String tradeDate = "2017-06-01T15:49:18Z";
Syed
  • 2,471
  • 10
  • 49
  • 89
-3
votes
2 answers

Any ideas on how I could compare 2 dates in string format?

Any ideas on how I could compare 2 dates in string format: String1 = "Wed May 18 00:00:00 CDT 2011" String2= "May. 18, 2011" I tried converting String1 to date format of String2 but was not very successful. I tried converting String1 to date using…
-3
votes
1 answer

How to handle negative ISO 8601 date string in java?

I am trying to convert ISO 8601 date string to epoch time. How do I handle negative dates? Is the below code correct? Should I use something else instead of simple date format library? Negative dates are for BC. String formatString =…
Zack
  • 2,078
  • 10
  • 33
  • 58
-4
votes
3 answers

How to Convert JSON Date Format to Simple Date Format?

I am receiving response of Date in JSON format like /Date(1521866513877+0530)/ which I want in format like this 24/03/2018 10:11:53.
-4
votes
2 answers

How to Convert String(2017-08-01T15:15:03.313000000+02:00) to TimeStamp

String str = "2017-08-01T15:15:03.313456768+02:00"; // The following statement gives IllegalArgumentExceptionTimestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] Timestamp timeStamp = Timestamp.valueOf(str); ZonedDateTime zoneddate =…
1 2 3
28
29