博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
DaTeText2
阅读量:4681 次
发布时间:2019-06-09

本文共 481 字,大约阅读时间需要 1 分钟。

import java.text.ParseException;
import java.util.Date;
public class Text2 {
 public static void main(String[] args) throws ParseException {
  Date d = new Date();
  String s = DateDemo1.dateToString(d, "h:mm a");
  System.out.println(s);
  String ss=DateDemo1.dateToString(d, "yyyy.MM.dd G 'at' HH:mm:ss z" );
  System.out.println(ss);
  
     String str ="2018.10.27";
     Date d2=DateDemo1.stringToDate(str, "yyyy.MM.dd");
     System.out.println(d2);
 }
}

转载于:https://www.cnblogs.com/rong123/p/9887427.html

你可能感兴趣的文章
leetcode-17-电话号码的字母组合’
查看>>
Flume 示例
查看>>
Designing for Performance
查看>>
HTML属性的应用
查看>>
HEAP CORRUPTION DETECTED
查看>>
Android URI简单介绍
查看>>
蒙板 模态对话框
查看>>
【POJ - 3009】Curling 2.0 (dfs+回溯)
查看>>
Windows下载安装良心教程
查看>>
Android上下文菜单ContextMenu
查看>>
【bzoj4543】Hotel加强版(thr)
查看>>
[stm32] 中断
查看>>
RTP Payload Format for Transport of MPEG-4 Elementary Streams over http
查看>>
两个时间相差多少 .net中的timespan应用
查看>>
递归 换零钱问题——由打靶子问题引申
查看>>
Python-函数基础
查看>>
Extensible Messaging and Presence Protocol (XMPP) 简介
查看>>
Farm Irrigation
查看>>
windows平板的开发和选型
查看>>
无平方因子的数(数论初步) By ACReaper
查看>>