0

When I try the following code,

public static void main(String[] args) throws ParseException{ try { Calendar calendar = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); calendar.setTime(sdf.parse("Sun Feb 22 18:02:51 FET 2015")); } catch (Exception e) { e.printStackTrace(); } } 

I systematically get

java.text.ParseException: Unparseable date: "Sun Feb 22 18:02:51 FET 2015" at java.text.DateFormat.parse(DateFormat.java:357) at foo.Sample.main(LogEntry.java:131) 

I realize that my issue is the FET timezone. That is a valid timezone. I have tried different things including using Locale.English but to no avail.

My issue seems to be due to the timezone as explained here.

EDIT

The following does not work either

SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US); 

Here is another post I found but didn't help me.

2
  • 1
    You haven't fixed all your references to the FET timezone. This website timeanddate.com/time/zones/fetsays to use MSK in place of FET Commented Apr 13, 2016 at 2:53
  • @chengpohi I use Ubuntu... Commented Apr 13, 2016 at 4:01

1 Answer 1

2

Java doesn't seem to support FET.

Use MSK.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.