【问题标题】:java.text.ParseException: Unparseable date: "IST"java.text.ParseException:无法解析的日期:“IST”
【发布时间】:2015-07-05 10:58:02
【问题描述】:

当我尝试将 String 对象转换为 Date 对象时,出现 java.text.ParseException: Unparseable date: "IST" 异常。我试图在论坛上找到解决方案,但这些都没有帮助。

Date expiry=null;
SimpleDateFormat format = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy");

String actualDate;
if(!(actualDate=token.nextToken()).equals("null")){
    expiry = format.parse(actualDate);
}//if

【问题讨论】:

  • 什么是actualDate

标签: java parsing date selenium selenium-webdriver


【解决方案1】:

actualDate = token.nextToken() 中存储的字符串是“IST”,它不代表日期。检查您已标记化的字符串源,可能不是标记流中的日期。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-05
    • 2013-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多