UCT格式转换成CST格式

来源:互联网 发布:用数据讲故事 pdf 编辑:程序博客网 时间:2024/06/05 09:43
/**
     * UCT格式转换成CST格式
     *
     * @param uct
     * @return
     * @throws ParseException
     */
    public static Date getCST(String uct) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat(
                "EEE MMM dd HH:mm:ss 'UTC+0800' yyyy", Locale.ENGLISH);
        Date date;
        if (uct.length() <= 10) {
            sdf = new SimpleDateFormat("yyyy-MM-dd");
        }
        date = sdf.parse(uct);
        return date;
    }
阅读全文
0 0