File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to convert Java Date into Unix Time? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to convert Java Date into Unix Time?" Watch "How to convert Java Date into Unix Time?" New topic
Author

How to convert Java Date into Unix Time?

ahmad mudassar
Greenhorn

Joined: Dec 05, 2001
Posts: 3
Hi,
How can a java Date be converted into Unix Time, Is there any API function available for that?
Any help appreciated.
Thanks
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
As the API documentation says, Date.getTime() "returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
". Hope this is what you wanted.
Might I suggest, though, that a question that can be answered simply by reading the API is not really for the advanced forum?


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
 
 
subject: How to convert Java Date into Unix Time?
 
Similar Threads
ProcessBuilder
convert unix milli seconds to java date :-)
Date conversion returns wrong value
ProcessBuilder
How to convert Java Date into Unix Time?