---
title: "Date转为Long的方法"
author: "abeetle"
date: "2007-08-21T14:57:00Z"
tags: []
slug: "date-long"
draft: false
lastmod: "2007-08-21T14:57:00Z"
id: 233848
url: "https://abeetle.iteye.com/blog/233848"
---

![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)    Long time=System.currentTimeMillis();  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)    Date time1=new Date();  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)    Long tmp=time1.getTime();  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)      
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)    System.out.println("currentTimeMillis="+time);  
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)    System.out.println("time1="+tmp);