View Single Post
Old 12-25-2009   #5
Tawa
 
Tawa's Avatar
 
Last Online: 12-20-2021
Join Date: Mar 2006
Posts: 6,245
Thanks: 2,121
Thanked 3,365 Times in 1,740 Posts
Groans: 29
Groaned at 44 Times in 35 Posts
Default

It's definitely new year's countdown.

Code:
import java.util.Calendar;
import java.text.DateFormat;
import java.text.SimpleDateFormat;


public class Test{
    public static void main(String args[]){
        DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS");

        long now = (System.currentTimeMillis()/1000 + X)*1000;
        /* X should have the value of the number shown on google countdown */

        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(now);
        
        System.out.println(now + " = " + formatter.format(calendar.getTime()));
    }
}

This game me the date:
01/01/2010 12:00:00.000
__________________
What we do in life, echoes in eternity.
Tawa is offline   Reply With Quote