Questions tagged [parseexception]

A Java ParseException gets raised whenever a ParseObject issues an invalid request.

A Java ParseException gets raised whenever a ParseObject issues an invalid request, such as deleting or editing an object that no longer exists on the server, or when there is a network failure preventing communication with the Parse server.

177 questions
56
votes
9 answers

java.text.ParseException: Unparseable date

I am getting a parsing exception while I am trying the following code: String date="Sat Jun 01 12:53:10 IST 2013"; SimpleDateFormat sdf=new SimpleDateFormat("MMM d, yyyy HH:mm:ss"); Date currentdate; currentdate=sdf.parse(date); …
Ami
  • 4,071
  • 6
  • 36
  • 68
13
votes
3 answers

DecimalFormat converts numbers with non-digits

Using DecimalFormat gives no parse exception when using this kind of number: 123hello which is obviously not really a number, and converts to 123.0 value. How can I avoid this kind of behaviour? As a side note hello123 does give an exception, which…
marcel
  • 302
  • 1
  • 7
11
votes
7 answers

SimpleDateFormat parse(string str) doesn't throw an exception when str = 2011/12/12aaaaaaaaa?

Here is an example: public MyDate() throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/d"); sdf.setLenient(false); String t1 = "2011/12/12aaa"; System.out.println(sdf.parse(t1)); } 2011/12/12aaa is not a…
Terminal User
  • 803
  • 3
  • 12
  • 21
10
votes
2 answers

ParseException Java

I am writing an appointment program that allows the user to input appointment dates, description, and type of appointment. Everything works correctly until they make a selection to "Print Range" which prints a range of dates, when they choose to do…
codeFinatic
  • 159
  • 1
  • 3
  • 17
9
votes
3 answers

java.text.ParseException: Unparseable date

I get the following error: ´java.text.ParseException: Unparseable date: "Aug 31 09:53:19 2011"´ with this format: new SimpleDateFormat("MMM dd HH:mm:ss yyyy"); Does anyone see the problem?
Stijn.V
  • 617
  • 2
  • 9
  • 23
8
votes
8 answers

SimpleDateFormat "Unparseable date" Exception

I am trying to parse datetime string with SimpleDateFormat.parse() but I keep receiving Unparseable date exceptions. Here is the date format I am trying to parse: 2011-10-06T12:00:00-08:00 Here is the code I am using: try { String dateStr =…
Wade
  • 822
  • 1
  • 8
  • 15
8
votes
10 answers

Deprecated Date methods in Java?

What is really meant when using Java Date utilities and something has been deprecated. Does this mean that it is discouraged to use, or does it imply that it is forbidden? I am guessing it is bad practice to use deprecated methods, but am not sure…
TheJediCowboy
  • 7,686
  • 27
  • 121
  • 184
7
votes
5 answers

java.text.ParseException: Unparseable date: yyyy-MM-dd HH:mm:ss.SSSSSS

I am getting ParseException for the following code String dateStr = "2011-12-22 10:56:24.389362"; String formatStr = "yyyy-MM-dd HH:mm:ss.SSSSSS"; Date testDate = null; SimpleDateFormat sdf= new SimpleDateFormat(formatStr); …
Praneeth
  • 1,387
  • 5
  • 21
  • 35
7
votes
2 answers

SimpleDateFormat: unparseable date exception

After looking after several existing posts, I am still not able to get my SimpleDateFormat parser working. Here is the code: SimpleDateFormat df = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z", Locale.US); try { volcanoListDate =…
Nils Blum-Oeste
  • 5,588
  • 4
  • 21
  • 25
7
votes
1 answer

Multiple wildcards in one query in elasticsearch

curl localhost:9200/tweet/posts/_search -d '{ "query": { "and": [ { "wildcard": { "_all": "*pet*" } }, { "wildcard": { "_all": "*rom*" } } ] } }' This gives me…
user2742004
  • 71
  • 1
  • 1
  • 2
6
votes
1 answer

java.text.parseException: Unparseable date : 2020-02-06T08:00:00

Getting parse exception when I'm applying a particular format to the date. SimpleDateFormat df = new SimpleDateFormat("hh:mm a"); try { String s=timeSlotsArrayList.get(position).getScheduledStartTime(); Date d = df.parse(s); …
Priyanka
  • 103
  • 1
  • 9
5
votes
6 answers

How to convert UTC Date String and remove the T and Z in Java?

Am using Java 1.7. Trying to convert: 2018-05-23T23:18:31.000Z into 2018-05-23 23:18:31 DateUtils class: public class DateUtils { public static String convertToNewFormat(String dateStr) throws ParseException { TimeZone utc =…
PacificNW_Lover
  • 4,008
  • 18
  • 76
  • 122
5
votes
1 answer

ParseException; must be caught (Try/Catch) (Java)

I am writing an appointment program and am getting the following errors: AppointmentNew.java:68: unreported exception java.text.ParseException; must be caught or declared to be thrown Date lowDate = sdf.parse(stdin.nextLine()); …
user2213611
  • 91
  • 2
  • 4
  • 13
4
votes
3 answers

Time parsing issue on Android

I am getting a parse exception when trying to parse the time string 02:22 p.m.. I have the following conversion function: public static long convertdatetotimestamp(String datestring, String newdateformat, String olddateformat){ SimpleDateFormat…
SARATH V
  • 449
  • 6
  • 25
4
votes
1 answer

JUnit4 test causes java.text.ParseException: Unparseable date

I can successfully execute the following code snippet in an Android project: SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ", Locale.US); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); Date date = null; try { …
JJD
  • 44,755
  • 49
  • 183
  • 309
1
2 3
11 12