±Û¾´ÀÌ :À±°æ±¸ 1999³â 10¿ù 12ÀÏ 15:40:45
In Reply to: °í¸¿¿ü¾î¿ä.. but ±×·¡µµ ¾ÈµÇ´Â ±º¿ä....¾Æ½Ã´Â ºÐÀº ¾Ë·ÁÁÖ¼¼¿ä.... posted by ¿Í´Ï on 1999³â 10¿ù 12ÀÏ 15:17:40:
¹Ù·Î Date À¯ÇüÀ» ÁöÁ¤Çϸé StringÀ¸·Î º¯È¯Çϱâ À§ÇØ
Date Ŭ·¡½ºÀÇ toString() ¸Þ½îµå°¡ È£ÃâµË´Ï´Ù.
¾Æ¸¶µµ ÀÌ toString() ¸Þ½îµå°¡ º¯È¯ÇØÁÖ´Â ¹®ÀÚ¿ÀÌ
¾×¼¼½º°¡ ¿ä±¸ÇÏ´Â SQL ¹®ÀÇ Æ÷¸Ë°ú ´Ù¸£±â ¶§¹®¿¡ ¿¡·¯°¡ ¹ß»ýÇÒ °ÍÀÔ´Ï´Ù.
´ÙÀ½°ú ºñ½ÁÇÏ°Ô ¾×¼¼½º°¡ ¿ä±¸ÇÏ´Â ¼½ÄÀ¸·Î ¹Ù²ãÁÖ¸é µÉ °Ì´Ï´Ù.
/**
* getTimeString method
* @returns formatted current time representation
*/
public static String getTimeString(java.util.Date date) {
// Format the current time. SimpleDateFormat formatter
// required format needs a space trail the string
java.text.SimpleDateFormat formatter =
new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss ");
return formatter.format(date);
}