java.lang.String无法强制转换为java.util.GregorianCalendar

时间:2014-08-09 16:37:52

标签: java

我得到的字符串如下:java.util.GregorianCalendar[time=1407440700000,areFieldsSet=true,areAllFieldsSet=true,lenient=false,zone=sun.util.calendar.ZoneInfo[id="GMT+05:30",offset=19800000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2014,MONTH=7,WEEK_OF_YEAR=32,WEEK_OF_MONTH=2,DAY_OF_MONTH=8,DAY_OF_YEAR=220,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=2,AM_PM=0,HOUR=1,HOUR_OF_DAY=1,MINUTE=15,SECOND=0,MILLISECOND=0,ZONE_OFFSET=19800000,DST_OFFSET=0]我要投射到 GregorianCalendar

下面的代码给了我例外:

Object publishDateGen =  (Object)publishedDate;
GregorianCalendar calanderFromPublishedDate = (GregorianCalendar)publishDateGen;

这里发布日期是需要转换的字符串。

由于

0 个答案:

没有答案