±ÍÇÏ´Â ¼Õ´Ô À̽ʴϴÙ
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ
  
  µ¨¸¶´ç °ø½Ä ÀºÇà°èÁÂ
  ÇϳªÀºÇà 227-910235-83607
  ¿¹±ÝÁÖ ÀÌ»ó±¹(¿î¿µÁø)
ÇÁ·ÎÁ§Æ® °Ô½ÃÆÇ
ÅõÇ¥°Ô½ÃÆÇ
µ¨¸¶´ç¼Ò°³
±âÃʺÎÅÍ È°¿ë±îÁö! µ¨ÆÄÀÌ ±³À° - µ¥ºê±â¾î
ÀÚ·á½Ç ÀÚ·á½Ç ÀÔ´Ï´Ù.
±Û³»¿ë - ÀÚ·á½Ç
 DateUtils.pas ³¯Â¥ÇÔ¼ö Á¤¸®-
hurssi
(¼Õ´Ô)
2006-01-20 ¿ÀÈÄ 2:51:33
18656ȸ Á¶È¸


÷ºÎÆÄÀÏ ´Ù¿î·Îµå
21_DateUtils.rar
µ¨ÆÄÀÌ¿¡ ³¯Â¥ÇÔ¼ö¸¦ ¸ð¾ÆµÐ DateUtils.pas °¡ ÀÖ½À´Ï´Ù.
¸Ó... ´Ùµé ¾Ë°íÀÖ°ÚÁö¸¸...^^
DateUtils.pasÀÇ ³»¿ëÀÌ Á¤¸®µÈ°Ô ¾ø´Â°Å °°¾Æ¼­ ³ª¸§ Á¤¸®Çؼ­ ¿Ã¸³´Ï´Ù.
ÀÖ´ÂÁö ¸ô¶ó¼­ ¸¸µé¾î ¾²´ø ÇÔ¼öµéÀÌ ... ¿©±â ¸î¸î º¸ÀÌ´õ±º¿ä.
¿Ø¸¸ÇÑ ³¯Â¥ 󸮴 ´Ù µÉ°Í °°°í...

´ã¿¡ ¶Ç- ´Ù¸¥ SysUtils.pas¸¦ Á¤¸®Çؼ­ ¿Ã¸®°Ú½À´Ï´Ù. ^^


//ÀÏÀÚ¸¦ ÃßÃâÇÑ´Ù.
function DateOf(const AValue: TDateTime): TDateTime;

//½Ã°£À» ÃßÃâÇÑ´Ù.
function TimeOf(const AValue: TDateTime): TDateTime;

//Æò³â,À±³âÀ» ±¸ºÐÇÏ´Ù.
function IsInLeapYear(const AValue: TDateTime): Boolean;

//¿ÀÀü,¿ÀÈĸ¦ ±¸ºÐÇÑ´Ù.
function IsPM(const AValue: TDateTime): Boolean;

//WordÇüÀÇ ³â,¿ù,ÀÏ ÆĶó¸ÞŸÀÇ À¯È¿¼ºÀ» üũÇÑ´Ù.
function IsValidDate(const AYear, AMonth, ADay: Word): Boolean;

//WordÇüÀÇ ½Ã,ºÐ,ÃÊ,¹Ð¸®ÃÊ ÆĶó¸ÞŸÀÇ À¯È¿¼ºÀ» üũÇÑ´Ù.
function IsValidTime(const AHour, AMinute, ASecond, AMilliSecond: Word): Boolean;

//WordÇüÀÇ ³â,¿ù,ÀÏ,½Ã,ºÐ,ÃÊ,¹Ð¸®ÃÊ ÆĶó¸ÞŸÀÇ À¯È¿¼ºÀ» üũÇÑ´Ù.
function IsValidDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: Word): Boolean;

//ex) IsValidDateDay(2006,45) : 2006³âÀÇ 45¹ø°³¯ÀÌ À¯È¿ÇÑÁö¸¦ üũÇÑ´Ù.
function IsValidDateDay(const AYear, ADayOfYear: Word): Boolean;

//ex) IsValidDateWeek(2006,42) : 2006³âÀÇ 42ÁÖÂ÷°¡ À¯È¿ÇÑÁö¸¦ üũÇÑ´Ù.
function IsValidDateWeek(const AYear, AWeekOfYear, ADayOfWeek: Word): Boolean;

//³â,¿ù,¿ùÀÇÁÖÂ÷,¿äÀÏ ÀÌ À¯È¿ÇÑÁö¸¦ üũÇÑ´Ù.
//ex) IsValidDateMonthWeek(2006,2,1,2) : 2006³â 2¿ùÀÇ 1ÁÖÂ÷ÀÇ È­¿äÀÏÀÌ À¯È¿ÇÑÁö¸¦ üũÇÑ´Ù.
function IsValidDateMonthWeek(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: Word): Boolean;

//ex) WeeksInYear(Today) : ¿À´ÃÀÌ ³âÀÇ ¸îÁÖÂ÷ÀÎÁö ¸®ÅÏÇÑ´Ù.
function WeeksInYear(const AValue: TDateTime): Word;
function WeeksInAYear(const AYear: Word): Word;

//ex) DaysInYear(Today) : ¿À´ÃÀÌ ³âÀÇ ¸îÀÏ°ÀÎÁö ¸®ÅÏÇÑ´Ù.
function DaysInYear(const AValue: TDateTime): Word;
function DaysInAYear(const AYear: Word): Word;

//ex) DaysInMonth(Today) : ¿À´ÃÀÌ ¿ùÀÇ ¸îÀÏ°ÀÎÁö ¸®ÅÏÇÑ´Ù.
function DaysInMonth(const AValue: TDateTime): Word;
function DaysInAMonth(const AYear, AMonth: Word): Word;

//¿À´Ã-
function Today: TDateTime;

//¾îÁ¦-
function Yesterday: TDateTime;

//³»ÀÏ-
function Tomorrow: TDateTime;

//AValueÀÇ °ªÀÌ ¿À´ÃÀ̸é True¸¦ ¸®ÅÏÇÑ´Ù.
function IsToday(const AValue: TDateTime): Boolean;

//AValue, ABasis °°Àº³¯À̸é True¸¦ ¸®ÅÏÇÑ´Ù.
function IsSameDay(const AValue, ABasis: TDateTime): Boolean;


//³âÀ» ÃßÃâÇÑ´Ù.
function YearOf(const AValue: TDateTime): Word;

//¿ùÀ» ÃßÃâÇÑ´Ù.
function MonthOf(const AValue: TDateTime): Word;

//³âÀÇ ¸îÁÖÂ÷ÀÎÁö¸¦ ÃßÃâÇÑ´Ù.
function WeekOf(const AValue: TDateTime): Word;

//ÀÏÀÚ¸¸ ÃßÃâÇÑ´Ù.
//ex) DayOf(StrToDate('2006-06-27')) : 27À» ¸®ÅÏÇÑ´Ù.
function DayOf(const AValue: TDateTime): Word;

//½Ã°£À» ÃßÃâÇÑ´Ù(24½Ã°£´ÜÀ§)
function HourOf(const AValue: TDateTime): Word;

//ºÐÀ» ÃßÃâÇÑ´Ù.
function MinuteOf(const AValue: TDateTime): Word;

//Ãʸ¦ ÃßÃâÇÑ´Ù.
function SecondOf(const AValue: TDateTime): Word;

//¹Ð¸®Ãʸ¦ ÃßÃâÇÑ´Ù.
function MilliSecondOf(const AValue: TDateTime): Word;

//³âµµÀÇ ½ÃÀÛÀÏ
function StartOfTheYear(const AValue: TDateTime): TDateTime;
function StartOfAYear(const AYear: Word): TDateTime;

//³âµµÀÇ ¸¶Áö¸·ÀÏ
function EndOfTheYear(const AValue: TDateTime): TDateTime;
function EndOfAYear(const AYear: Word): TDateTime;

//¿ùÀÇ ½ÃÀÛÀÏ
function StartOfTheMonth(const AValue: TDateTime): TDateTime;
function StartOfAMonth(const AYear, AMonth: Word): TDateTime;

//¿ùÀÇ ¸¶Áö¸·ÀÏ
function EndOfTheMonth(const AValue: TDateTime): TDateTime;
function EndOfAMonth(const AYear, AMonth: Word): TDateTime;

//ÁÖÀÇ ½ÃÀÛÀÏ
function StartOfTheWeek(const AValue: TDateTime): TDateTime;

//ÁÖÀÇ ½ÃÀÛÀÏ(±âÁØ¿äÀÏÀ» Á¤ÇÒ¼ö ÀÖ´Ù.)
//1:¿ù¿äÀÏ, 2:È­¿äÀÏ, 3:¼ö¿äÀÏ, 4:¸ñ¿äÀÏ ,5:±Ý¿äÀÏ , 6:Åä¿äÀÏ ,7:ÀÏ¿äÀÏ
function StartOfAWeek(const AYear, AWeekOfYear: Word; const ADayOfWeek: Word = 1): TDateTime;

//ÁÖÀÇ ¸¶Áö¸·ÀÏ
function EndOfTheWeek(const AValue: TDateTime): TDateTime;

//ÁÖÀÇ ¸¶Áö¸·ÀÏ(±âÁØ¿äÀÏÀ» Á¤ÇÒ¼ö ÀÖ´Ù.)
//1:¿ù¿äÀÏ, 2:È­¿äÀÏ, 3:¼ö¿äÀÏ, 4:¸ñ¿äÀÏ ,5:±Ý¿äÀÏ , 6:Åä¿äÀÏ ,7:ÀÏ¿äÀÏ
function EndOfAWeek(const AYear, AWeekOfYear: Word; const ADayOfWeek: Word = 7): TDateTime;



function StartOfTheDay(const AValue: TDateTime): TDateTime;
function StartOfADay(const AYear, AMonth, ADay: Word): TDateTime; overload;
function StartOfADay(const AYear, ADayOfYear: Word): TDateTime; overload;
function EndOfTheDay(const AValue: TDateTime): TDateTime;
function EndOfADay(const AYear, AMonth, ADay: Word): TDateTime; overload;
function EndOfADay(const AYear, ADayOfYear: Word): TDateTime; overload;


//ex) MonthOfTheYear(Today) : ¿À´ÃÀÏÀÚ¸¦ WordÇüÀ¸·Î ¸®ÅÏÇÑ´Ù.
function MonthOfTheYear(const AValue: TDateTime): Word;

//ex) WeekOfTheYear(Today) : ¿À´ÃÀÏÀÚ°¡ ¸îÁÖÂ÷ÀÎÁö¸¦ WordÇüÀ¸·Î ¸®ÅÏÇÑ´Ù.
function WeekOfTheYear(const AValue: TDateTime): Word; overload;
function WeekOfTheYear(const AValue: TDateTime; var AYear: Word): Word; overload;

//ex) DayOfTheYear(Today) : ¿À´ÃÀÏÀÚ°¡ ¿ÃÇØÀÇ ¸îÀÏ°ÀÎÁö¸¦ WordÇüÀ¸·Î ¸®ÅÏÇÑ´Ù.
function DayOfTheYear(const AValue: TDateTime): Word;

//³âÀÇ ½ÃÀÛÀϺÎÅÍ ÇØ´çÀÏÀÚ±îÁöÀÇ ½Ã°£À» ¸ðµÎ ´õÇؼ­ WordÇüÀ¸·Î ¸®ÅÏÇÑ´Ù.
function HourOfTheYear(const AValue: TDateTime): Word;

//³âÀÇ ½ÃÀÛÀϺÎÅÍ ÇØ´çÀÏÀÚ±îÁöÀÇ ºÐÀ» ¸ðµÎ ´õÇؼ­ WordÇüÀ¸·Î ¸®ÅÏÇÑ´Ù.
function MinuteOfTheYear(const AValue: TDateTime): LongWord;

//³âÀÇ ½ÃÀÛÀϺÎÅÍ ÇØ´çÀÏÀÚ±îÁöÀÇ ÃÊÀ» ¸ðµÎ ´õÇؼ­ WordÇüÀ¸·Î ¸®ÅÏÇÑ´Ù.
function SecondOfTheYear(const AValue: TDateTime): LongWord;

//³âÀÇ ½ÃÀÛÀϺÎÅÍ ÇØ´çÀÏÀÚ±îÁöÀÇ ¹Ð¸®ÃÊÀ» ¸ðµÎ ´õÇؼ­ WordÇüÀ¸·Î ¸®ÅÏÇÑ´Ù.
function MilliSecondOfTheYear(const AValue: TDateTime): Int64;

//ÀÌ´ÞÀÇ ¸î¹ø°ÁÖ ÀÎÁö¸¦ ¸®ÅÏÇÑ´Ù.
function WeekOfTheMonth(const AValue: TDateTime): Word; overload;
function WeekOfTheMonth(const AValue: TDateTime; var AYear, AMonth: Word): Word; overload;

//ÀÌ´ÞÀÇ ¸îÀÏ°ÀÎÁö¸¦ ¸®ÅÏÇÑ´Ù.
function DayOfTheMonth(const AValue: TDateTime): Word;

//¿ùÀÇ ½ÃÀÛÀϺÎÅÍ ÇØ´çÀÏÀÚ±îÁöÀÇ ½Ã°£ÀÇ ÇÕÀ» ¸®ÅÏÇÑ´Ù.
function HourOfTheMonth(const AValue: TDateTime): Word;

//¿ùÀÇ ½ÃÀÛÀϺÎÅÍ ÇØ´çÀÏÀÚ±îÁöÀÇ ºÐÀÇ ÇÕÀ» ¸®ÅÏÇÑ´Ù.
function MinuteOfTheMonth(const AValue: TDateTime): Word;

//¿ùÀÇ ½ÃÀÛÀϺÎÅÍ ÇØ´çÀÏÀÚ±îÁöÀÇ ÃÊÀÇ ÇÕÀ» ¸®ÅÏÇÑ´Ù.
function SecondOfTheMonth(const AValue: TDateTime): LongWord;

//¿ùÀÇ ½ÃÀÛÀϺÎÅÍ ÇØ´çÀÏÀÚ±îÁöÀÇ ¹Ð¸®ÃÊÀÇ ÇÕÀ» ¸®ÅÏÇÑ´Ù.
function MilliSecondOfTheMonth(const AValue: TDateTime): LongWord;

//ÇØ´çÀÏÀÇ ¿äÀÏÀ» ¸®ÅÏÇÑ´Ù.
//1:¿ù¿äÀÏ, 2:È­¿äÀÏ, 3:¼ö¿äÀÏ, 4:¸ñ¿äÀÏ ,5:±Ý¿äÀÏ , 6:Åä¿äÀÏ ,7:ÀÏ¿äÀÏ
function DayOfTheWeek(const AValue: TDateTime): Word;

//AValue³¯Â¥ÀÇ ÁÖÀÇ ½ÃÀÛÀϺÎÅÍ AValue³¯Â¥±îÁöÀÇ ½Ã°£ÀÇ ÇÕÀ» °è»êÇÑ´Ù.
function HourOfTheWeek(const AValue: TDateTime): Word;

//AValue³¯Â¥ÀÇ ÁÖÀÇ ½ÃÀÛÀϺÎÅÍ AValue³¯Â¥±îÁöÀÇ ºÐÀÇ ÇÕÀ» °è»êÇÑ´Ù.
function MinuteOfTheWeek(const AValue: TDateTime): Word;

//AValue³¯Â¥ÀÇ ÁÖÀÇ ½ÃÀÛÀϺÎÅÍ AValue³¯Â¥±îÁöÀÇ ÃÊÀÇ ÇÕÀ» °è»êÇÑ´Ù.
function SecondOfTheWeek(const AValue: TDateTime): LongWord;

//AValue³¯Â¥ÀÇ ÁÖÀÇ ½ÃÀÛÀϺÎÅÍ AValue³¯Â¥±îÁöÀÇ ¹Ð¸®ÃÊÀÇ ÇÕÀ» °è»êÇÑ´Ù.
function MilliSecondOfTheWeek(const AValue: TDateTime): LongWord;

//ex) HourOfTheDay(Time) : 24½Ã°£ ´ÜÀ§·Î Time±îÁöÀÇ ½Ã°£ÀÇ ÇÕÀ» °è»êÇÑ´Ù.
function HourOfTheDay(const AValue: TDateTime): Word;

//ex) MinuteOfTheDay(Time) : 24½Ã°£ ´ÜÀ§·Î Time±îÁöÀÇ ºÐÀÇ ÇÕÀ» °è»êÇÑ´Ù.
function MinuteOfTheDay(const AValue: TDateTime): Word;

//ex) SecondOfTheDay(Time) : 24½Ã°£ ´ÜÀ§·Î Time±îÁöÀÇ ÃÊÀÇ ÇÕÀ» °è»êÇÑ´Ù.
function Sec