DateTimeOffset.Minute 속성

정의

현재 DateTimeOffset 개체가 나타내는 시간의 분 구성 요소를 가져옵니다.

public:
 property int Minute { int get(); };
public int Minute { get; }
member this.Minute : int
Public ReadOnly Property Minute As Integer

속성 값

Int32

현재 DateTimeOffset 개체의 분 구성 요소이며, 0에서 59 사이의 정수로 표현됩니다.

예제

다음 예제에서는 세 가지 방법으로 개체의 DateTimeOffset 분 구성 요소를 표시합니다.

  • 값을 검색 하 여 Minute 속성입니다.

  • "m" 형식 지정자를 사용하여 메서드를 호출 ToString(String) 합니다.

  • "mm" 형식 지정자를 사용하여 메서드를 호출 ToString(String) 합니다.

DateTimeOffset theTime = new DateTimeOffset(2008, 5, 1, 10, 3, 0,
                                           DateTimeOffset.Now.Offset);
Console.WriteLine("The minute component of {0} is {1}.",
                  theTime, theTime.Minute);

Console.WriteLine("The minute component of {0} is{1}.",
                  theTime, theTime.ToString(" m"));

Console.WriteLine("The minute component of {0} is {1}.",
                  theTime, theTime.ToString("mm"));
// The example produces the following output:
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 03.
let theTime = DateTimeOffset(2008, 5, 1, 10, 3, 0, DateTimeOffset.Now.Offset)
printfn $"The minute component of {theTime} is {theTime.Minute}."

printfn $"""The minute component of {theTime} is{theTime.ToString " m"}."""

printfn $"The minute component of {theTime} is {theTime:mm}."

// The example produces the following output:
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
//    The minute component of 5/1/2008 10:03:00 AM -08:00 is 03.
Dim theTime As New DateTimeOffset(#5/1/2008 10:03AM#, _
                                       DateTimeOffset.Now.Offset)
Console.WriteLine("The minute component of {0} is {1}.", _
                  theTime, theTime.Minute)

Console.WriteLine("The minute component of {0} is{1}.", _
                  theTime, theTime.ToString(" m"))

Console.WriteLine("The minute component of {0} is {1}.", _
                  theTime, theTime.ToString("mm"))
' The example produces the following output:
'    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
'    The minute component of 5/1/2008 10:03:00 AM -08:00 is 3.
'    The minute component of 5/1/2008 10:03:00 AM -08:00 is 03.

설명

속성은 Minute 속성 값의 Offset 영향을 받지 않습니다.

"m" 또는 "mm" 사용자 지정 형식 지정자를 사용하여 메서드를 호출 ToString 하여 개체의 분 구성 요소에 대한 문자열 표현 DateTimeOffset 을 만들 수도 있습니다.

적용 대상