Wed Apr 27 00:00:00 GMT-700 1988 という文字列が表示され、それを日付に変換するために
Date dateOfBirth = new Date(bean.getUserProfileBean().getDateOfBirth());
これは失敗し、その理由はわかりません。それがGAEに固有のものであるかどうか、何か考えはありますか?
Wed Apr 27 00:00:00 GMT-700 1988 という文字列が表示され、それを日付に変換するために
Date dateOfBirth = new Date(bean.getUserProfileBean().getDateOfBirth());
これは失敗し、その理由はわかりません。それがGAEに固有のものであるかどうか、何か考えはありますか?
日付に空のコンストラクターがあるか、Date(long)
から日付を取得する場合String
は、使用する必要がありますSimpleDateFormat
試す:
stirng strDate = bean.getUserProfileBean().getDateOfBirth();
Date date = new SimpleDateFormat("EEE MMM d HH:mm:ss z yyyy",
Locale.ENGLISH).parse(strDate );
この回答を参照してください
または、Joda-Time のDateTimeFormatterを使用することもできますが、'z'
従来のタイムゾーン名で問題が発生する可能性があります。
stirng strDate = bean.getUserProfileBean().getDateOfBirth();
DateTimeFormatter dtf = DateTimeFormat.forPattern("EEE MMM d HH:mm:ss z yyyy");
dtf.parseDateTime(strDate);