Cannot Parse Date from Twitter

时间:2015-05-12 22:59:07

标签: java date twitter

I´m getting a list of twitter dates via the search API of twitter.

Error
empty?: undefined;
 cannot reference undefined identifier

function call                                       output
(interchange '( ))                                  ()
(interchange '(a))                                  (a)
(interchange '(a  b))                               (b a)
(interchange '(a  b  c))                            (b a c)
(interchange '(a  1  b  2  c  3  d  4))             (1 a 2 b 3 c 4 d)
(interchange '(hello  you  -12.34  5  -6  enough))  (you hello 5 -12.34 enough -6)

Can anyone help me see what I´m doing wrong?

I don´t see any errors in my date format. However, I´m getting an unparseable date Exception on the String dateString = ((JSONObject)ar.get(i)).get("created_at").toString(); // Ej: "Tue May 12 19:58:26 +0000 2015" String TWITTER="EEE MMM dd HH:mm:ss ZZZZZ yyyy"; SimpleDateFormat sf = new SimpleDateFormat(TWITTER); Date d = sf.parse(dateString); LocalDate localDate = LocalDate.parse( new SimpleDateFormat("yyyy-MM-dd").format(d) ); line.

1 个答案:

答案 0 :(得分:1)

TOP 10000 is Locale dependent, so just use an explicit english Locale:

SimpleDateFormat