Date

来源:互联网 发布:阿里云api怎么使用 编辑:程序博客网 时间:2024/06/07 01:22
public class DateDemo {public static void main(String[] args) {Date d = new Date();System.out.println(d);//将模式封装到SimpleDateFormat对象中SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 E hh时mm分ss秒");//调用format方法让模式格式化指定Date对象String time = sdf.format(d);System.out.println(time);}}


原创粉丝点击