首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

JAVA date处置

2012-10-28 
JAVA date处理Date nownew Date()Long nowTimenow.getTime()Long monthAgonowTime-1000*60*60*24*30L

JAVA date处理

    Date now=new Date();Long nowTime=now.getTime();Long monthAgo=nowTime-1000*60*60*24*30L;//不加L不行...还得基本功好啊Calendar cal=Calendar.getInstance();cal.setTimeInMillis(monthAgo);SimpleDateFormat smf=new SimpleDateFormat("yyyy-MM-dd");end=smf.format(now);start=smf.format(cal.getTime());

热点排行