Mega Code Archive

 
Categories / Java Tutorial / Development
 

Seconds since the epoch

import java.util.Date; public class MainClass {   public static void main(String[] args) {     Date now = new Date();     System.out.printf("seconds since the epoch: %ts/%Ts\n", now, now);   } } // seconds since the epoch: 1178825794/1178825794