|
¸ñ·ÏÀ¸·Î °¡±â.. |
|
1) CDate Date ÇÏÀ§ Çü½ÄÀÇ Variant·Î º¯È¯µÈ ½ÄÀ» ¹ÝȯÇÑ´Ù. ±¸¹® : CDate(date) date Àμö´Â À¯È¿ÇÑ ³¯Â¥½ÄÀÌ¸é µÈ´Ù. º¯È¯°ªÀº ÄÄÇ»ÅÍÀÇ ³¯Â¥/½Ã°£ ¼³Á¤¿¡ µû¸£¸ç ªÀº ³¯Â¥ Ç¥±â¹ýÀ¸·Î Ãâ·ÂµÈ´Ù. ¡Ü cdate.asp <%@ Language=VBScript %> <% MyDate = "2000³â 12¿ù 11ÀÏ" Response.Write MyDate & "<BR>" Response.Write CDate(MyDate) %>
2) Date ÇöÀç ½Ã½ºÅÛÀÇ ³¯Â¥¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : Date ¡Ü date.asp <%@ Language=VBScript %> <% Response.Write Date %>
3) DateAdd ÁöÁ¤µÈ ³¯Â¥¿¡ ½Ã°£À» Ãß°¡Çϰųª »« »õ·Î¿î ³¯Â¥¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : DateAdd(interval, number, date) ¡Ü interval : ÇʼöÀûÀÎ Àμö·Î intervalÀ» Ãß°¡ÇÑ ³¯Â¥¸¦ ³ªÅ¸³»´Â ¹®ÀÚ½ÄÀÌ´Ù. ±× °ª¿¡ ´ëÇؼ´Â ¾Æ·¡ÀÇ Ç¥¸¦ ÂüÁ¶Ç϶ó. ¡Ü number : ÇʼöÀûÀÎ Àμö·Î Ãß°¡ÇÒ °£°Ý ¼öÀÇ ¼ö½ÄÀÌ´Ù. ¼ö½Ä¿¡¼ ¾ç¼ö´Â ¹Ì·¡ÀÇ ³¯Â¥, À½¼ö´Â °ú°ÅÀÇ ³¯Â¥ÀÌ´Ù. ¡Ü date : ÇʼöÀûÀÎ Àμö·Î intervalÀ» Ãß°¡ÇÑ ³¯Â¥¸¦ ³ªÅ¸³»´Â Variant ¶Ç´Â ¸®ÅÍ·²ÀÌ´Ù. ¡Ü interval Àμö ¼³Á¤ ¼³¸í yyyy ³â q ºÐ±â m ¿ù y ÀÏ(Àϳ⠱âÁØ) d ÀÏ w ¿äÀÏ ww ÁÖ(Àϳ⠱âÁØ) h ½Ã n ºÐ s ÃÊ
¡Ü dateadd.asp <%@ Language=VBScript %> <% MyDate = Date Response.Write "¿À´Ã³¯Â¥ : " & MyDate & "<BR>" Response.Write "¿À´Ã³¯Â¥+3°³¿ù : " & DateAdd("m",3,MyDate) & "<BR>" Response.Write "¿À´Ã³¯Â¥-3°³¿ù : " & DateAdd("m",-3,MyDate) & "<BR>" %>
4) DateDiff ÁÖ¾îÁö´Â µÎ ³¯Â¥ÀÇ °£°ÝÀ» ¹ÝȯÇÑ´Ù. ±¸¹® : DateDiff(interval, date1, date2 [,firstdayofweek[, firstweekofyear]]) ¡Ü interval : ÇʼöÀûÀÎ Àμö·Î ³¯Â¥1°ú ³¯Â¥2 »çÀÌÀÇ Â÷À̸¦ °è»êÇÏ´Â µ¥ »ç¿ëÇÒ intervalÀÇ ¹®ÀÚ½ÄÀÌ´Ù. ±× °ª¿¡ ´ëÇؼ´Â ¾Æ·¡ÀÇ Ç¥¸¦ ÂüÁ¶Ç϶ó. ¡Ü date1, date2 : ÇʼöÀûÀÎ Àμö·Î ³¯Â¥½Ä¿¡¼ °è»ê¿¡ »ç¿ëÇÒ µÎ ³¯Â¥ÀÌ´Ù. ¡Ü firstdayofweek : ¼±ÅÃÀûÀÎ Àμö·Î ¿äÀÏÀ» ÁöÁ¤ÇÏ´Â »ó¼ö·Î ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é ÀÏ¿äÀÏ·Î °£ÁÖÇÑ´Ù. ±× °ª¿¡ ´ëÇؼ´Â ¾Æ·¡ÀÇ Ç¥¸¦ ÂüÁ¶Ç϶ó. ¡Ü firstweekofyear : ¼±ÅÃÀûÀÎ Àμö·Î ¿¬µµ¸¦ ±âÁØÀ¸·Î ÇÑ Ã¹Â° ÁÖ¸¦ ÁöÁ¤ÇÏ´Â »ó¼öÀÌ´Ù. ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é 1¿ù 1ÀÏÀ» Æ÷ÇÔÇÏ´Â ÁÖ¸¦ ù° ÁÖ·Î °£ÁÖÇÑ´Ù. ±× °ª¿¡ ´ëÇؼ´Â ¾Æ·¡ÀÇ Ç¥¸¦ ÂüÁ¶Ç϶ó. ¡Ü interval Àμö ¼³Á¤ ¼³¸í yyyy ³â q ºÐ±â m ¿ù y ÀÏ(Àϳ⠱âÁØ) d ÀÏ w ¿äÀÏ ww ÁÖ(Àϳ⠱âÁØ) h ½Ã n ºÐ s ÃÊ ¡Ü firstdayofweek Àμö »ó¼ö °ª ¼³¸í vbUseSystem 0 NLS(National Language Support) API ¼³Á¤ »ç¿ë vbSunday 1 ÀÏ¿äÀÏ(±âº»°ª) vbMonday 2 ¿ù¿äÀÏ vbTuesday 3 È¿äÀÏ vbWednesday 4 ¼ö¿äÀÏ vbThursday 5 ¸ñ¿äÀÏ vbFriday 6 ±Ý¿äÀÏ vbSaturday 7 Åä¿äÀÏ ¡Ü firstweekofyear Àμö »ó¼ö °ª ¼³¸í vbUseSystem 0 NLS(National Language Support) API ¼³Á¤ »ç¿ë vbFirstJan1 1 1¿ù 1ÀÏÀ» Æ÷ÇÔÇÏ´Â ÁÖ¿¡¼ ½ÃÀÛ(±âº»°ª) vbFirstFourDays 2 »õÇØÀÇ Ã³À½ 4ÀÏÀ» Æ÷ÇÔÇÏ´Â ÁÖ¿¡¼ ½ÃÀÛ vbFirstFullWeek 3 »õÇØÀÇ Ã³À½ ÇÑ ÁÖÀÏ(7ÀÏ)À» Æ÷ÇÔÇÏ´Â ÁÖ¿¡¼ ½ÃÀÛ ¡Ü datediff.asp <%@ Language=VBScript %> <% FirstDate = CDate("2000³â 1¿ù 1ÀÏ") MyDate = Date Response.Write FirstDate & "ºÎÅÍ Áö±Ý±îÁö " & DateDiff("y", FirstDate, MyDate) & "ÀÏ °æ°ú <BR>" Response.Write FirstDate & "ºÎÅÍ Áö±Ý±îÁö " & DateDiff("h", FirstDate, MyDate) & "½Ã °æ°ú <BR>" Response.Write FirstDate & "ºÎÅÍ Áö±Ý±îÁö " & DateDiff("n", FirstDate, MyDate) & "ºÐ °æ°ú <BR>" Response.Write FirstDate & "ºÎÅÍ Áö±Ý±îÁö " & DateDiff("s", FirstDate, MyDate) & "ÃÊ °æ°ú <BR>" %>
5) DatePart ÁÖ¾îÁø ³¯Â¥ÀÇ ÁöÁ¤µÈ ºÎºÐÀ» ¹ÝȯÇÑ´Ù. ±¸¹® : DatePart(interval, date[, firstdayofweek[, firstweekofyear]]) ¡Ü interval : ÇʼöÀûÀÎ Àμö·Î ¹ÝȯÇÒ ½Ã°£ °£°ÝÀÇ ¹®ÀÚ½ÄÀÌ´Ù. ±× °ª¿¡ ´ëÇؼ´Â ¾Æ·¡ÀÇ Ç¥¸¦ ÂüÁ¶Ç϶ó. ¡Ü date : ÇʼöÀûÀÎ Àμö·Î °è»êÇÒ ³¯Â¥½ÄÀÌ´Ù. ¡Ü firstdayof week : ¼±ÅÃÀûÀÎ Àμö·Î ¿äÀÏÀ» ÁöÁ¤ÇÏ´Â »ó¼ö·Î¼ ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é ÀÏ¿äÀÏ·Î °£ÁÖÇÑ´Ù. ±× °ª¿¡ ´ëÇؼ´Â ¾Æ·¡ÀÇ Ç¥¸¦ ÂüÁ¶Ç϶ó. ¡Ü firstweekofyear : ¼±ÅÃÀûÀÎ Àμö·Î ¿¬µµ¸¦ ±âÁØÀ¸·Î ÇÑ Ã¹Â° ÁÖ¸¦ ÁöÁ¤ÇÏ´Â »ó¼öÀÌ´Ù. ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é 1¿ù 1ÀÏÀ» Æ÷ÇÔÇÏ´Â ÁÖ¸¦ ù° ÁÖ·Î °£ÁÖÇÑ´Ù. ±× °ª¿¡ ´ëÇؼ´Â ¾Æ·¡ÀÇ Ç¥¸¦ ÂüÁ¶Ç϶ó. ¡Ü interval Àμö ¼³Á¤ ¼³¸í yyyy ³â qºÐ±â m ¿ù y ÀÏ(Àϳ⠱âÁØ) d ÀÏ w ¿äÀÏ ww ÁÖ(Àϳ⠱âÁØ) h ½Ã n ºÐ s ÃÊ
¡Ü firstdayofweek Àμö »ó¼ö °ª ¼³¸í vbUseSystem 0 NLS(National Language Support) API ¼³Á¤ »ç¿ë vbSunday 1 ÀÏ¿äÀÏ(±âº»°ª) vbMonday 2 ¿ù¿äÀÏ vbTuesday 3 È¿äÀÏ vbWednesday 4 ¼ö¿äÀÏ vbThursday 5 ¸ñ¿äÀÏ vbFriday 6 ±Ý¿äÀÏ vbSaturday 7 Åä¿äÀÏ ¡Ü firstweekofyear Àμö »ó¼ö °ª ¼³¸í vbUseSystem 0 NLS(National Language Support) API ¼³Á¤ »ç¿ë vbFirstJan1 1 1¿ù 1ÀÏÀ» Æ÷ÇÔÇÏ´Â ÁÖ¿¡¼ ½ÃÀÛ(±âº»°ª) vbFirstFourDays 2 »õÇØÀÇ Ã³À½ 4ÀÏÀ» Æ÷ÇÔÇÏ´Â ÁÖ¿¡¼ ½ÃÀÛ vbFirstFullWeek 3 »õÇØÀÇ Ã³À½ ÇÑ ÁÖÀÏ(7ÀÏ)À» Æ÷ÇÔÇÏ´Â ÁÖ¿¡¼ ½ÃÀÛ ¡Ü datepart.asp <%@ Language=VBScript %> <% Today = Now Response.Write "¿À´Ã " & Today & "Àº " & DatePart("q", Today) & "ºÐ±â ÀÔ´Ï´Ù." %>
6) DateSerial ÁöÁ¤µÈ ³â, ¿ù, ÀÏÀÇ Date ÇÏÀ§ Çü½ÄÀÎ Variant¸¦ ¹ÝȯÇÑ´Ù. Áï ÀÓÀÇÀÇ ¼ýÀÚ¸¦ ÀÔ·Â¹Þ¾Æ ³¯Â¥ Çü½ÄÀ¸·Î ¹ÝȯÇÏ´Â ÇÔ¼öÀÌ´Ù. ±¸¹® : DateSerial(year, month, day) ¡Ü year : 100¿¡¼ 9999±îÁöÀÇ ¼ö ¶Ç´Â ¼ö½Ä ¡Ü month : ¸ðµç ¼ö½Ä ¡Ü day : ¸ðµç ¼ö½Ä ¡Ü dateserial.asp --------------------------------------------------------------------------------------------------- <%@ Language=VBScript %> <% Response.Write DateSerial(2000+1, 12+3, 2+5) %>
7) DateValue Date ÇÏÀ§ Çü½ÄÀÇ Variant¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : DateValue(date) ´ë°³ date Àμö´Â 100³â 1¿ù 1ÀÏ¿¡¼ 9999³â 12¿ù 31ÀϱîÁö¸¦ ³ªÅ¸³»´Â ¹®ÀÚ½ÄÀ¸·Î ÀÌ ¹üÀ§¿¡ ÀÖ´Â ³¯Â¥, ½Ã°£ ¶Ç´Â ³¯Â¥/½Ã°£À» ³ªÅ¸³»´Â ½ÄÀÌ´Ù. date Àμö¿¡ ½Ã°£ Á¤º¸°¡ ÀÖ´Â °æ¿ì DateValue ÇÔ¼ö¿¡¼´Â ±× Á¤º¸¸¦ ¹ÝȯÇÏÁö ¾Ê´Â´Ù. ±×·¯³ª date Àμö¿¡ "12:11"ó·³ À߸øµÈ ½Ã°£ Á¤º¸°¡ ÀÖÀ¸¸é ¿À·ù°¡ ¹ß»ýÇÏ°Ô µÈ´Ù. date Àμö°¡ À¯È¿ÇÑ ³¯Â¥ ±¸ºÐ ±âÈ£·Î ºÐ¸®µÈ ¼ýÀÚ¸¸ ÀÖ´Â ¹®ÀÚ¿ÀÎ °æ¿ì, DateValue ÇÔ¼ö¿¡¼´Â ÄÄÇ»ÅÍ¿¡ ¼³Á¤ÇÑ °£´ÜÇÑ Ç¥½Ã ³¯Â¥ Çü½Ä¿¡ µû¶ó ³â, ¿ù, ÀÏ¿¡ ´ëÇÑ ¼ø¼·Î ÀνÄÇÏ°Ô µÈ´Ù. ¶ÇÇÑ Á¤½ÄÀ̳ª ¾à½ÄÀÇ ¿ù À̸§À» Æ÷ÇÔÇÏ°í ÀÖ´Â ¸íÈ®ÇÑ ³¯Â¥µµ ÀνÄÇÑ´Ù. ¿¹¸¦ µé¾î DateValue ÇÔ¼ö´Â 1/23/2001°ú 1/23/01 »Ó¸¸ ¾Æ´Ï¶ó January 23,2001°ú Jan 23,2001À» ¸ðµÎ ÀνÄÇÑ´Ù. date Àμö¿¡¼ ¿¬µµ ºÎºÐÀ» »ý·«ÇÒ °æ¿ì DateValue ÇÔ¼ö´Â ÄÄÇ»ÅÍ ½Ã½ºÅÛ¿¡ ¼³Á¤µÇ¾î ÀÖ´Â ÇöÀç ¿¬µµ¸¦ »ç¿ëÇÑ´Ù. ¡Ü datevalue.asp <%@ Language=VBScript %> <% Response.Write DateValue("2000³â 12¿ù 25ÀÏ") %>
8) Day ³¯Â¥¸¦ ³ªÅ¸³»´Â 1¿¡¼ 31±îÁöÀÇ Á¤¼ö¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : Day(date) date Àμö´Â ³¯Â¥¸¦ Ç¥ÇöÇÏ´Â ½ÄÀÌ´Ù. date Àμö¿¡ NullÀÌ ÀÖÀ¸¸é NullÀ» ¹ÝȯÇÑ´Ù. ¡Ü day.asp <%@ Language=VBScript %> <% Response.Write Day("2000³â 12¿ù 25ÀÏ") %>
9) Hour ÇÏ·çÀÇ ½Ã°£À» ³ªÅ¸³»´Â 0¿¡¼ 23±îÁöÀÇ Á¤¼ö¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : Hour(time) time Àμö´Â ½Ã°£À» ³ªÅ¸³»´Â ½ÄÀÌ´Ù. timeÀÌ NullÀ̸é NullÀ» ¹ÝȯÇÑ´Ù. ¡Ü hour.asp <%@ Language=VBScript %> <% Response.Write "Áö±Ý ½Ã°£Àº " & Now & " ÀÔ´Ï´Ù. <BR>" Response.Write "½Ã°£Àº " & Hour(Now) & "½Ã ÀÔ´Ï´Ù." %>
10) IsDate ÇÑ ½ÄÀÌ ³¯Â¥·Î º¯È¯µÉ ¼ö ÀÖ´ÂÁö ¿©ºÎ¸¦ ³ªÅ¸³»´Â ºÎ¿ï °ªÀ» ¹ÝȯÇÑ´Ù. ³¯Â¥ Çü½ÄÀ» ±¸ºÐÇÒ ¶§ ÁÖ·Î »ç¿ëÇÑ´Ù. ±¸¹® : IsDate(expression) expression Àμö´Â ³¯Â¥½Ä ¶Ç´Â ³¯Â¥³ª ½Ã°£À¸·Î ÀÎ½ÄµÉ ¼ö ÀÖ´Â ¹®ÀÚ½ÄÀÌ´Ù. IsDate ÇÔ¼ö´Â ÇØ´ç ½ÄÀÌ ³¯Â¥À̰ųª À¯È¿ÇÑ ³¯Â¥·Î º¯È¯µÉ ¼ö ÀÖ´Â °æ¿ì True¸¦, ±×·¸Áö ¾ÊÀ¸¸é False¸¦ ¹ÝȯÇÕ´Ï´Ù. Microsoft WindowsÀÇ À¯È¿ÇÑ ³¯Â¥ ¹üÀ§´Â ¼±â 100³â 1¿ù 1ÀÏ¿¡¼ ¼±â 9999³â 12¿ù 31ÀϱîÁöÀÌÁö¸¸, ¿î¿µ üÁ¦¿¡ µû¶ó ±× ¹üÀ§°¡ ´Þ¶óÁø´Ù. ¡Ü isdate.asp <%@ Language=VBScript %> <% FirstDate = "2000³â 12¿ù 11ÀÏ" SecondDate = "Hello! ASP~" If IsDate(FirstDate) Then Response.Write FirstDate & "´Â ³¯Â¥Çü½ÄÀÔ´Ï´Ù. <BR>" Else Response.Write FirstDate & "´Â ³¯Â¥Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù. <BR>" End If If IsDate(SecondDate) Then Response.Write SecondDate & "´Â ³¯Â¥Çü½ÄÀÔ´Ï´Ù. <BR>" Else Response.Write SecondDate & "´Â ³¯Â¥Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù. <BR>" End If %>
11) Minute ½Ã°£ÀÇ ºÐÀ» ³ªÅ¸³»´Â 0¿¡¼ 59±îÁöÀÇ Á¤¼ö¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : Minute(time) time Àμö´Â ½Ã°£À» ³ªÅ¸³»´Â ½ÄÀÌ´Ù. time¿¡ NullÀÌ ÀÖÀ¸¸é NullÀ» ¹ÝȯÇÑ´Ù. ¡Ü minute.asp <%@ Language=VBScript %> <% Response.Write "Áö±Ý ½Ã°£Àº " & Now & " ÀÔ´Ï´Ù. <BR>" Response.Write "ºÐÀº " & Minute(Now) & "ºÐ ÀÔ´Ï´Ù." %>
12) Month ³âÀÇ ¿ùÀ» ³ªÅ¸³»´Â 1¿¡¼ 12±îÁöÀÇ Á¤¼ö¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : Month(date) date Àμö´Â ³¯Â¥¸¦ ³ªÅ¸³»´Â ½ÄÀÌ´Ù. date¿¡ NullÀÌ ÀÖÀ¸¸é NullÀ» ¹ÝȯÇÑ´Ù. ¡Ü month.asp <%@ Language=VBScript %> <% Response.Write "Áö±Ý ½Ã°£Àº " & Now & " ÀÔ´Ï´Ù. <BR>" Response.Write Month(Now) & "¿ù ÀÔ´Ï´Ù." %>
13) MonthName ÁöÁ¤ÇÑ ¿ùÀ» ³ªÅ¸³»´Â ¹®ÀÚ¿À» ¹ÝȯÇÑ´Ù. ±¸¹® : MonthName(month[, abbreviate]) ¡Ü month : ÇʼöÀûÀÎ Àμö·Î 1¿ùÀº 1, 2¿ùÀº 2, µîµîÀ¸·Î ¿ùÀ» ³ªÅ¸³»´Â ¼ýÀÚÀÌ´Ù. ¡Ü abbreviate : ¼±ÅÃÀûÀÎ Àμö·Î ¿ù À̸§À» ¾à¾î ÇüÅ·Πǥ½ÃÇÒÁö ¿©ºÎ¸¦ ³ªÅ¸³»´Â ºÎ¿ï °ªÀÌ´Ù. »ý·«ÇÏ¸é ±âº»°ªÀÎ False°¡ µÇ¸ç, ¿ù À̸§À» ¿ÏÀüÇÑ ÇüÅ·Πǥ½ÃÇÑ´Ù. ¡Ü monthname.asp <%@ Language=VBScript %> <% Response.Write MonthName(12, true) & "<BR>" Response.Write MonthName(12, false) & "<BR>" %>
14) Now ÄÄÇ»ÅÍÀÇ ½Ã½ºÅÛ ³¯Â¥¿Í ½Ã°£¿¡ µû¸¥ ÇöÀç ³¯Â¥¿Í ½Ã°£À» ¹ÝȯÇÑ´Ù. ±¸¹® : Now ¡Ü now.asp <%@ Language=VBScript %> <% Response.Write "Áö±Ý ½Ã°£Àº " & Now & " ÀÔ´Ï´Ù." %>
15) Second ºÐÀÇ Ãʸ¦ ³ªÅ¸³»´Â 0¿¡¼ 59±îÁöÀÇ Á¤¼ö¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : Second(time) time Àμö´Â ½Ã°£À» ³ªÅ¸³»´Â ½ÄÀÌ´Ù. time Àμö¿¡ NullÀÌ ÀÖÀ¸¸é NullÀ» ¹ÝȯÇÑ´Ù. ¡Ü second.asp <%@ Language=VBScript %> <% Response.Write "Áö±Ý ½Ã°£Àº " & Now & " ÀÔ´Ï´Ù. <BR>" Response.Write Second(Now) & "ÃÊ ÀÔ´Ï´Ù." %>
16) Time ÇöÀç ½Ã½ºÅÛ ½Ã°£À» ³ªÅ¸³»´Â Date ÇÏÀ§ Çü½ÄÀÇ Variant¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : Time ¡Ü time.asp <%@ Language=VBScript %> <% Response.Write "Áö±Ý ½Ã°£Àº " & Time & " ÀÔ´Ï´Ù. <BR>" %>
17) Timer ÀÚÁ¤ ÀÌÈÄ °æ°úÇÑ ÃÊ ¼ö¸¦ ³ªÅ¸³»´Â Single °ªÀ» ¹ÝȯÇÑ´Ù. ±¸¹® : Timer ¡Ü timer.asp <%@ Language=VBScript %> <% Response.Write Timer & " ÃÊ °æ°ú ÀÔ´Ï´Ù. <BR>" %>
18) TimeSerial ÁöÁ¤ÇÑ ³â, ¿ù, ÀÏÀÇ Date ÇÏÀ§ Çü½ÄÀÎ Variant¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : TimeSerial(hour, minute, second) ¡Ü time : 0(¿ÀÀü 12:00)¿¡¼ 23(¿ÀÈÄ 11:00) »çÀÌÀÇ ¼ö(0°ú 23 Æ÷ÇÔ) ¶Ç´Â ¼ö½Ä ¡Ü minute : ¸ðµç ¼ö½Ä ¡Ü second : ¸ðµç ¼ö½Ä 10½Ã 51ºÐ 59ÃÊó·³ ¾î¶² ½Ã°£À» ÁöÁ¤ÇÏ·Á¸é °¢ TimeSerial ÀμöÀÇ ¼ýÀÚ´Â ÇØ´ç ÀμöÀÇ Çã¿ë ¹üÀ§ ¾È¿¡ ÀÖ¾î¾ß ÇÑ´Ù. Áï, ½Ã°£Àº 0-23À̸ç, ºÐ°ú ÃÊ´Â 0-59ÀÔ´Ï´Ù. ±×·¯³ª ƯÁ¤ ½Ã°£ÀÇ ¾ÕµÚ¿¡ ½Ã, ºÐ, Ãʸ¦ ³ªÅ¸³»´Â ¼ö½ÄÀ» »ç¿ëÇÏ¿© °¢ ÀμöÀÇ »ó´ëÀûÀÎ ½Ã°£À» ÁöÁ¤ÇÒ ¼öµµ ÀÖ´Ù. ¡Ü timeserial.asp <%@ Language=VBScript %> <% Response.Write TimeSerial(23, 12, 11) %>
19) TimeValue ½Ã°£À» Æ÷ÇÔÇÏ´Â Date ÇÏÀ§ Çü½ÄÀÇ Variant¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : TimeValue(time) ´ë°³ time Àμö´Â 0:00:00(¿ÀÀü 12:00:00)¿¡¼ 23:59:59(¿ÀÈÄ 11:59:59)±îÁöÀÇ ½Ã°£À» ³ªÅ¸³»´Â ¹®ÀÚ½ÄÀ¸·Î ÀÌ ¹üÀ§¿¡ ÀÖ´Â ½Ã°£À» ³ªÅ¸³»´Â ½Äµµ time Àμö°¡ µÉ ¼ö ÀÖ´Ù. time¿¡ NullÀÌ ÀÖÀ¸¸é NullÀ» ¹ÝȯÇÑ´Ù. ¡Ü timevalue.asp <%@ Language=VBScript %> <% Response.Write TimeValue("¿ÀÈÄ 11:11:11") %>
20) Weekday ¿äÀÏÀ» ³ªÅ¸³»´Â Á¤¼ö¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : Weekday(date, [firstdayofweek]) ¡Ü date : ³¯Â¥¸¦ ³ªÅ¸³»´Â ½ÄÀÌ´Ù. date¿¡ NullÀÌ ÀÖÀ¸¸é NullÀ» ¹ÝȯÇÑ´Ù. ¡Ü firstdayofweek : ù° ¿äÀÏÀ» ÁöÁ¤ÇÏ´Â »ó¼öÀÌ´Ù. »ý·«Çϸé vbSunday·Î °£ÁÖÇÑ´Ù. ¡Ü firstdayofweek Àμö »ó¼ö °ª ¼³¸í vbUseSystem 0 NLS( National Language Support) API ¼³Á¤ »ç¿ë vbSunday 1 ÀÏ¿äÀÏ vbMonday 2 ¿ù¿äÀÏ vbTuesday 3 È¿äÀÏ vbWednesday 4 ¼ö¿äÀÏ vbThursday 5 ¸ñ¿äÀÏ vbFriday 6 ±Ý¿äÀÏ vbSaturday 7 Åä¿äÀÏ
¡Ü Weekday ÇÔ¼ö ¹Ýȯ °ª »ó¼ö °ª ¼³¸í vbSunday 1 ÀÏ¿äÀÏ vbMonday 2 ¿ù¿äÀÏ vbTuesday 3 È¿äÀÏ vbWednesday 4 ¼ö¿äÀÏ vbThursday 5 ¸ñ¿äÀÏ vbFriday 6 ±Ý¿äÀÏ vbSaturday 7 Åä¿äÀÏ
¡Ü weekday.asp <%@ Language=VBScript %> <% MyDate = #2000-12-25# Response.Write Weekday(MyDate) %>
21) WeekdayName ÁöÁ¤µÈ ¿äÀÏÀ» ³ªÅ¸³»´Â ¹®ÀÚ¿À» ¹ÝȯÇÑ´Ù. ±¸¹® : WeekDayName(weekday, abbreviate, firstdayofweek)
¡Ü weekday : ÇʼöÀûÀÎ Àμö·Î ¿äÀÏÀ» ³ªÅ¸³»´Â ¼ýÀÚÀÌ´Ù. firstdayofweek ¼³Á¤¿¡ µû¶ó °¢ ¿äÀÏÀÇ °ªÀÌ ´Ù¸£´Ù. ¡Ü abbreviate : ¼±ÅÃÀûÀÎ Àμö·Î ¿äÀÏ À̸§À» ¾à¾î·Î ³ªÅ¸³¾Áö ¿©ºÎ¸¦ ³ªÅ¸³»´Â ºÎ¿ï °ªÀÌ´Ù. »ý·«ÇÏ¸é ±âº»°ªÀÎ False°¡ µÇ¸ç ¿äÀÏ À̸§À» ¿ÏÀüÇÑ ÇüÅ·Π³ªÅ¸³½´Ù. ¡Ü firstdayofweek : ¼±ÅÃÀûÀÎ Àμö·Î ù° ¿äÀÏÀ» ³ªÅ¸³»´Â ¼ýÀÚ °ªÀÌ´Ù. ±× °ª¿¡ ´ëÇؼ´Â ¾Æ·¡ÀÇ Ç¥¸¦ ÂüÁ¶Ç϶ó.
¡Ü firstdayofweek Àμö »ó¼ö °ª ¼³¸í vbUseSystem 0 NLS( National Language Support) API ¼³Á¤ »ç¿ë vbSunday 1 ÀÏ¿äÀÏ vbMonday 2 ¿ù¿äÀÏ vbTuesday 3 È¿äÀÏ vbWednesday 4 ¼ö¿äÀÏ vbThursday 5 ¸ñ¿äÀÏ vbFriday 6 ±Ý¿äÀÏ vbSaturday 7 Åä¿äÀÏ
¡Ü weekdayname.asp
<%@ Language=VBScript %> <% MyDate = #2000-12-25# Response.Write Weekdayname(Weekday(MyDate)) %>
22) Year ¿¬µµ¸¦ ³ªÅ¸³»´Â Á¤¼ö¸¦ ¹ÝȯÇÑ´Ù. ±¸¹® : Year(date) date Àμö´Â ³¯Â¥¸¦ ³ªÅ¸³»´Â ½ÄÀÌ´Ù. date¿¡ NullÀÌ ÀÖ´Ù¸é NullÀ» ¹ÝȯÇÑ´Ù. ¡Ü year.asp <%@ Language=VBScript %> <% Response.Write "Áö±Ý ½Ã°£Àº " & Now & " ÀÔ´Ï´Ù. <BR>" Response.Write Year(Now) & "³âµµ ÀÔ´Ï´Ù." %>
|
|
|