ÇöÀç ½Ã°£ ¾Ë¾Æ³»´Â ¿¹Á¦
TestDateTime.java
import java.util.Date;
public class TestDateTime {
public static void main(String args[]) {
Date d = new Date();
System.out.println("time is now " + d.toString());
System.out.println();
try {
Thread.sleep(5000);
} catch (Exception e) {}
d.setTime(System.currentTimeMillis());
System.out.println("time is now " + d.toString());
}
}
C:\javaExample\util>javac TestDateTime.java
C:\javaExample\util>java TestDateTime
time is now Fri Jan 04 14:21:48 KST 2002
time is now Fri Jan 04 14:21:53 KST 2002
ÇöÀç ½Ã°£À» ¾Ë¾Æ³»±â À§Çؼ´Â DateŬ·¡½ºÀÇ toString()¸Þ¼µå¸¦ ÀÌ¿ëÇÑ´Ù.
jabookÀúÀÚ¸íÇÔ |
Á¦¸ñ:¼Ò¼³°°Àº¹Ì´ÏÄÚµå ÀÛ¼ºÀÚ:Àںϸâ¹ö ±è¿Ï±â |