Chinaunix首页 | 论坛 | 博客
  • 博客访问: 418118
  • 博文数量: 114
  • 博客积分: 3361
  • 博客等级: 中校
  • 技术积分: 1060
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-18 13:14
文章分类

全部博文(114)

文章存档

2012年(1)

2011年(84)

2010年(29)

分类:

2011-03-01 13:37:21

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class MainClass {

  public static void main(String[] argsthrows ParseException {
    int year = 2003;
    int month = 12;
    int day = 12;

    String date = year + "/" + month + "/" + day;
    java.util.Date utilDate = null;

    try {
      SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
      utilDate = formatter.parse(date);
      System.out.println("utilDate:" + utilDate);
    catch (ParseException e) {
      System.out.println(e.toString());
      e.printStackTrace();
    }

  }
}

from:


阅读(741) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~