PrintQueue.StartTimeOfDay 속성

정의

프린터에서 작업을 인쇄할 자정 UTC(협정 세계시)(그리니치 표준시 [GMT]라고도 함) 이후의 시간(분)으로 표현되는 하루 중 가장 빠른 시간을 가져오거나 설정합니다.

public:
 virtual property int StartTimeOfDay { int get(); void set(int value); };
public virtual int StartTimeOfDay { get; set; }
member this.StartTimeOfDay : int with get, set
Public Overridable Property StartTimeOfDay As Integer

속성 값

프린터를 처음 사용할 수 있게 되는 시간(UTC)은 자정 이후의 시간(분)으로 표시됩니다. 최대값은 1439입니다. Microsoft Windows 프린터 추가 마법사를 사용하여 프린터를 처음 설치하는 경우 프린터는 항상 사용할 수 있으며 이 속성은 모든 표준 시간대에서 0을 반환합니다.

예제

다음 예제에서는 현재 프린터를 사용할 수 있는지 여부를 확인 하려면이 속성을 사용 하는 방법을 보여 집니다.

private: 
   static void ReportAvailabilityAtThisTime (System::String^% statusReport, System::Printing::PrintQueue^ pq) 
   {
      if (pq->StartTimeOfDay != pq->UntilTimeOfDay)
      {
         System::DateTime utcNow = DateTime::UtcNow;
         System::Int32 utcNowAsMinutesAfterMidnight = (utcNow.TimeOfDay.Hours * 60) + utcNow.TimeOfDay.Minutes;

         // If now is not within the range of available times . . .
         if (!((pq->StartTimeOfDay < utcNowAsMinutesAfterMidnight) && (utcNowAsMinutesAfterMidnight < pq->UntilTimeOfDay)))
         {
            statusReport = statusReport + " Is not available at this time of day. ";
         }
      }
   };
private static void ReportAvailabilityAtThisTime(ref String statusReport, PrintQueue pq)
{
    if (pq.StartTimeOfDay != pq.UntilTimeOfDay) // If the printer is not available 24 hours a day
    {
DateTime utcNow = DateTime.UtcNow;
Int32 utcNowAsMinutesAfterMidnight = (utcNow.TimeOfDay.Hours * 60) + utcNow.TimeOfDay.Minutes;
        
        // If now is not within the range of available times . . .
        if (!((pq.StartTimeOfDay < utcNowAsMinutesAfterMidnight) 
           &&
           (utcNowAsMinutesAfterMidnight < pq.UntilTimeOfDay)))
        {
            statusReport = statusReport + " Is not available at this time of day. ";
        }
    }
}
Private Shared Sub ReportAvailabilityAtThisTime(ByRef statusReport As String, ByVal pq As PrintQueue)
    If pq.StartTimeOfDay <> pq.UntilTimeOfDay Then ' If the printer is not available 24 hours a day
Dim utcNow As Date = Date.UtcNow
Dim utcNowAsMinutesAfterMidnight As Int32 = (utcNow.TimeOfDay.Hours * 60) + utcNow.TimeOfDay.Minutes

        ' If now is not within the range of available times . . .
        If Not((pq.StartTimeOfDay < utcNowAsMinutesAfterMidnight) AndAlso (utcNowAsMinutesAfterMidnight < pq.UntilTimeOfDay)) Then
            statusReport = statusReport & " Is not available at this time of day. "
        End If
    End If
End Sub

설명

UTC 표준 시간대가 아닌 경우 60의 배수를 추가하거나 빼서 표준 시간대에 대한 올바른 시간을 설정하거나 가져와야 합니다. 예를 들어 북미 태평양 표준 시간대에 있고 일광 절약 시간이 적용되지 않는 경우 현지 시간은 UTC보다 8시간 이전입니다. 표준 시간대에서 오전 12시로 설정하려면 오전 8시 UTC(480= 8 * 60)로 설정합니다 StartTimeOfDay . 또한 24시간(즉, 1439분 이후)이 지나면 시간이 0으로 넘어가는 것을 기억해야 합니다. 표준 시간대에서 오후 6시로 설정하려면 오전 2시 UTC(120= 2 * 60)로 설정합니다. 메서드를 조작하는 데 도움이 되는 표준 시간대는 < a0/ 및 클래스를 참조하세요.

프린터를 항상 사용할 수 있는 경우이 속성은 모든 표준 시간대에서 0을 반환 합니다.

적용 대상

추가 정보