728x90
package test;
import java.text.SimpleDateFormat;
import java.util.*;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
TimeZone.setDefault(TimeZone.getTimeZone("GMT"));
Date date;
// SimpleDateFormat date_format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat date_format = new SimpleDateFormat("dd MM yyyy HH:mm:ss");
String today;
Calendar now = Calendar.getInstance();
date = now.getTime();
System.out.println(date_format.format(date));
//today= date.toGMTString();
System.out.println(date.toGMTString());
// System.out.println(date);
System.out.println(now.getTime());
}
}
728x90
'콤퓨타 > JAVA' 카테고리의 다른 글
hashmap 관련 (0) | 2013.02.20 |
---|---|
빈 줄 인식 (0) | 2013.02.20 |
FileInputStream / FileOutputStream 정의 (0) | 2013.02.20 |
call by reference/value (0) | 2013.02.20 |
static, final (0) | 2013.02.20 |
댓글