JavaのDateオブジェクトのtoString()をparseする方法
DateオブジェクトをtoString()すると以下の形式のStringが得られる.
EEE MMM dd HH:mm:ss zzz yyyy
この形式で出力されたStringをparseして再び別のDateオブジェクトとして格納したいと思ったが,
そのままDateFormatでparseしても上手く行かない.
そこで,SimpleDateFormatで次のようにLocale.USで扱えばよい.
SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
このLocale.USがポイントで,これを指定しないとparseできない.
以上のようにすることで無事parseすることができた.
参考: http://stackoverflow.com/questions/4713825/how-to-parse-output-of-new-date-tostring