티스토리 뷰

Delphi

function DayOfWeek(const DateTime: TDateTime): Word;

C++

extern PACKAGE System::Word __fastcall DayOfWeek(const System::TDateTime DateTime);

Properties

Type

Visibility

Source

Unit

Parent

function

public

System.SysUtils.pas

System.SysUtils.hpp

System.SysUtils

System.SysUtils

Description

Returns the day of the week for a specified date.

DayOfWeek returns the day of the week of the specified date as an integer between 1 and 7, where Sunday is the first day of the week and Saturday is the seventh.

Note: DayOfWeek is not compliant with the ISO 8601 standard, which defines Monday as the first day of the week.

For an ISO 8601 compliant version, use the DayOfTheWeek function instead.

 

지정된 날짜의 요일을 반환합니다.

DayOfWeek는 지정된 날짜의 요일을 1에서 7 사이의 정수로 반환합니다. 일요일이 주의 첫 번째 날이고 토요일이 일곱 번째입니다.

참고: DayOfWeek은 월요일을 첫 번째 요일로 정의하는 ISO 8601 표준을 준수하지 않습니다.

ISO 8601 호환 버전의 경우 DayOfTheWeek 함수를 대신 사용하십시오.

 

Example

var

  SpecifiedDate: TDateTime;

  StrDate: string;

  Day: Integer;

begin

  // 2017 4월 둘 째주

  for Day := 9 to 16 do

  begin

    StrDate := '2017-04-';

    StrDate := StrDate + IntToStr(Day);

    SpecifiedDate := StrToDate(StrDate);

    Writeln(StrDate + ': ' + IntToStr(DayOfWeek(SpecifiedDate)));

  end;

 

  { 결과:

    2017-04-9: 1

    2017-04-10: 2

    2017-04-11: 3

    2017-04-12: 4

    2017-04-13: 5

    2017-04-14: 6

    2017-04-15: 7

    2017-04-16: 1 }

 

  Readln;

end.

 

compliant 미국·영국 [kəm|plaɪənt]   영국식   

1. 순응하는, 따르는; (법률을) 준수하는
2. (
일정한 규칙에) 부응하는

 

출처: http://docwiki.embarcadero.com/Libraries/XE2/en/System.SysUtils.DayOfWeek

'프로그래밍 언어 > Delphi' 카테고리의 다른 글

[Reference] System.SysUtils.AddExitProc  (0) 2017.04.14
[Reference] System.SysUtils.Abort  (2) 2017.04.13
[Reference] System.Trunc  (0) 2017.04.11
[Reference] System.Math.SameValue  (0) 2017.04.10
[Reference] System.IOResult  (0) 2017.04.09
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함