Tag: format预览模式: 普通 | 列表
08-06
20

format String to Date

jdk中已经不再推荐用Date.parse(String arg);这样的直接的转换,取而代之的是:
                     String birthdayS = request.getParameter("birthday");
            DateFormat f=new SimpleDateFormat("yyyy-MM-dd");
            try {
                birthday=f.parse(birthdayS);
            } catch (ParseException e) {
                e.printStackTrace();
                log.error("When format birthday from String to Date  is error");
            }

查看更多...

Tags: format String Date

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 564
08-06
19

java date format

import java.util.Date;
import java.text.DateFormat;


/**
* 格式化时间类
* DateFormat.FULL = 0
* DateFormat.DEFAULT = 2
* DateFormat.LONG = 1

查看更多...

Tags: java Date format

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 1083