다음을 통해 공유


DayOfWeek 열거형

요일을 지정합니다.

네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public Enumeration DayOfWeek
‘사용 방법
Dim instance As DayOfWeek
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public enum DayOfWeek
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public enum class DayOfWeek
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public enum DayOfWeek
SerializableAttribute 
ComVisibleAttribute(true) 
public enum DayOfWeek

멤버

  멤버 이름 설명
Supported by the .NET Compact Framework Friday 금요일을 나타냅니다. 
Supported by the .NET Compact Framework Monday 월요일을 나타냅니다. 
Supported by the .NET Compact Framework Saturday 토요일을 나타냅니다. 
Supported by the .NET Compact Framework Sunday 일요일을 나타냅니다. 
Supported by the .NET Compact Framework Thursday 목요일을 나타냅니다. 
Supported by the .NET Compact Framework Tuesday 화요일을 나타냅니다. 
Supported by the .NET Compact Framework Wednesday 수요일을 나타냅니다. 

설명

DayOfWeek 열거는 주 당 7일인 달력의 요일을 나타냅니다. 이 열거 범위는 0부터 시작하며, 0은 일요일을 나타내고 6은 토요일을 나타냅니다.

이 열거는 강력한 형식의 사양을 가진 주의 요일이 필요할 경우 유용합니다. 예를 들어, 이 열거는 DateTime.DayOfWeek 속성에 대한 속성 값의 형식입니다.

예제

다음 예제에서는 DateTime.DayOfWeek 속성 및 DayOfWeek 열거형을 보여 줍니다.

' This example demonstrates the DateTime.DayOfWeek property
Imports System

Class Sample
   Public Shared Sub Main()
      ' Assume the current culture is en-US.
      ' Create a DateTime for the first of May, 2003.
      Dim dt As New DateTime(2003, 5, 1)
      Console.WriteLine("Is Thursday the day of the week for {0:d}?: {1}", _
                         dt, dt.DayOfWeek = DayOfWeek.Thursday)
      Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek)
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'
'Is Thursday the day of the week for 5/1/2003?: True
'The day of the week for 5/1/2003 is Thursday.
'
// This example demonstrates the DateTime.DayOfWeek property
using System;

class Sample 
{
    public static void Main() 
    {
// Assume the current culture is en-US.
// Create a DateTime for the first of May, 2003.
    DateTime dt = new DateTime(2003, 5, 1);
    Console.WriteLine("Is Thursday the day of the week for {0:d}?: {1}", 
                       dt, dt.DayOfWeek == DayOfWeek.Thursday);
    Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek);
    }
}
/*
This example produces the following results:

Is Thursday the day of the week for 5/1/2003?: True
The day of the week for 5/1/2003 is Thursday.
*/
// This example demonstrates the DateTime.DayOfWeek property
using namespace System;
int main()
{
   
   // Assume the current culture is en-US.
   // Create a DateTime for the first of May, 2003.
   DateTime dt = DateTime(2003,5,1);
   Console::WriteLine(  "Is Thursday the day of the week for {0:d}?: {1}", dt, dt.DayOfWeek == DayOfWeek::Thursday );
   Console::WriteLine(  "The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek );
}

/*
This example produces the following results:

Is Thursday the day of the week for 5/1/2003?: True
The day of the week for 5/1/2003 is Thursday.
*/
// This example demonstrates the DateTime.DayOfWeek property
import System.*;

class Sample
{
    public static void main(String[] args)
    {
        // Assume the current culture is en-US.
        // Create a DateTime for the first of May, 2003.
        DateTime dt = new DateTime(2003, 5, 1);
        Console.WriteLine("Is Thursday the day of the week for {0:d}?: {1}", 
            dt, (System.Boolean)(dt.get_DayOfWeek() == DayOfWeek.Thursday));
        Console.WriteLine("The day of the week for {0:d} is {1}.", dt, 
            dt.get_DayOfWeek());
    } //main
} //Sample
/*
This example produces the following results:

Is Thursday the day of the week for 5/1/2003?: True
The day of the week for 5/1/2003 is Thursday.
*/

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

System 네임스페이스