方寸心间

一路走,十年不回头

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Ø        描述:           封装了对一些对日期常见的操作方法。

Ø        类ID          DateUtils

Ø        方法:

方法名

描述

 

 

getToday( )

得到当前日期字符串

On Entry:

 

On Exit:

return 当前日期 "yyyy-MM-dd"格式获取

format(Date)

将日期型转换为字符型.转换后的日期格式为yyyy-MM-dd

On Entry:

Date: : Tue Jan 01 00:09:00 CST 2002  

 

On Exit:

return String 返回字符型日期

getTime()

获得当前时间.显示格式如:2008-07-18 10:21:41

On Entry:

 

On Exit:

return String返回当前时间字符串

getTimeNoSeparate( )

获得当前时间.显示格式如:20080826102109一般用于作为新建文件夹或者文件名的一部分

On Entry:

 

On Exit:

return String返回当前时间字符串

getNow()

得到当前日期,格式如:20080825

On Entry:

 

On Exit:

return String返回当前日期字符串

formatString

将字符串转换成Date型如:2008-08-25 to Wed Aug 24 00:00:00 CST 2005

On Entry:

 

On Exit:

return Date返回Date型日期.

 

Ø        代码:

 

Code
posted on 2008-08-14 16:56  方寸心间  阅读(2150)  评论(0编辑  收藏  举报