* 将字符串日期时间格式,转为毫秒
生活随笔
收集整理的這篇文章主要介紹了
* 将字符串日期时间格式,转为毫秒
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
import java.text.ParseException;
import java.text.SimpleDateFormat;/*** @author silence* 將字符串日期時(shí)間格式,轉(zhuǎn)為毫秒*/
public class Demo1 {public static void main(String[] args) throws ParseException {String start = "2020年11月11日 0:0:0";String end = "2020年11月11日 0:10:0";SimpleDateFormat simple = new SimpleDateFormat("yyyy年mm月dd日 HH:mm:ss");long startTime = simple.parse(start).getTime();long endTime = simple.parse(end).getTime();System.out.println(startTime);System.out.println(endTime);}}
總結(jié)
以上是生活随笔為你收集整理的* 将字符串日期时间格式,转为毫秒的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 信用卡取现提前还款利息怎么算 天数是关键
- 下一篇: 图片查找