// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ namespace Microsoft.Graph { using System; using Newtonsoft.Json; /// /// Time of day model. /// [JsonConverter(typeof(TimeOfDayConverter))] public class TimeOfDay { internal DateTime DateTime { get; set; } internal TimeOfDay(DateTime dateTime) { this.DateTime = dateTime; } /// /// Create a new TimeOfDay from hours, minutes, and seconds. /// /// The hour. /// The minute. /// The second. public TimeOfDay(int hour, int minute, int second) : this(new DateTime(1, 1, 1, hour, minute, second)) { } /// /// The hour. /// public int Hour { get { return this.DateTime.Hour; } } /// /// The minute. /// public int Minute { get { return this.DateTime.Minute; } } /// /// The second. /// public int Second { get { return this.DateTime.Second; } } /// /// The time of day, formatted as "HH:mm:ss". /// /// The string time of day. public override string ToString() { return this.DateTime.ToString("HH:mm:ss"); } } }