欢迎来到天天文库
浏览记录
ID:22689040
大小:100.51 KB
页数:16页
时间:2018-10-30
《《java的时间操作》word版》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、本资料由-大学生创业
2、创业
3、创业网http://www.chuangyw.com/提供资料java的时间操作2008年02月01日星期五11:12/**日期类*@date2003-12-04*@version1.0*/importjava.util.*;importjava.text.*;importjava.util.Calendar;publicclassVeDate{/***获取现在时间**@return返回时间类型yyyy-MM-ddHH:mm:ss*/publicstaticDategetNowDate(){DatecurrentTime=newDate
4、();SimpleDateFormatformatter=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");StringdateString=formatter.format(currentTime);ParsePositionpos=newParsePosition(8);DatecurrentTime_2=formatter.parse(dateString,pos);returncurrentTime_2;}/***获取现在时间**@return返回短时间格式yyyy-MM-dd*/publicstaticDategetNo
5、wDateShort(){DatecurrentTime=newDate();SimpleDateFormatformatter=newSimpleDateFormat("yyyy-MM-dd");StringdateString=formatter.format(currentTime);ParsePositionpos=newParsePosition(8);DatecurrentTime_2=formatter.parse(dateString,pos);returncurrentTime_2;}/***获取现在时间*在线代理
6、网页代理
7、代理网页
8、http:
9、//www.dailiav.com减肥药排行榜
10、淘宝最好的减肥药
11、什么减肥药效果最好
12、减肥瘦身药
13、http://pigproxy.cn本资料由-大学生创业
14、创业
15、创业网http://www.chuangyw.com/提供资料*@return返回字符串格式yyyy-MM-ddHH:mm:ss*/publicstaticStringgetStringDate(){DatecurrentTime=newDate();SimpleDateFormatformatter=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");Stringdate
16、String=formatter.format(currentTime);returndateString;}/***获取现在时间**@return返回短时间字符串格式yyyy-MM-dd*/publicstaticStringgetStringDateShort(){DatecurrentTime=newDate();SimpleDateFormatformatter=newSimpleDateFormat("yyyy-MM-dd");StringdateString=formatter.format(currentTime);returndateString;
17、}/***获取时间小时:分;秒HH:mm:ss**@return*/publicstaticStringgetTimeShort(){SimpleDateFormatformatter=newSimpleDateFormat("HH:mm:ss");DatecurrentTime=newDate();StringdateString=formatter.format(currentTime);returndateString;}/***将长时间格式字符串转换为时间yyyy-MM-ddHH:mm:ss**@paramstrDate*@return*/publicst
18、aticDatestrToDateLong(StringstrDate){SimpleDateFormatformatter=newSimpleDateFormat("yyyy-MM-ddHH:mm:ss");ParsePositionpos=newParsePosition(0);Datestrtodate=formatter.parse(strDate,pos);returnstrtodate;在线代理
19、网页代理
20、代理网页
21、http://www.dailiav.com减肥药排行榜
22、淘宝最好的减肥药
23、什么减肥药效果最好
24、减肥瘦身药
25、http://pigproxy
26、.cn本资
此文档下载收益归作者所有