static void Main(string[] args) { Time date = new Time(); Console.WriteLine(date.ToString()); Console.WriteLine(Time.Now()); }
static void Main() { var date = new DateTime(2015, 12, 1, 20, 00, 00); var currentDateTime = new Time(date); //Result: Print Current Date and Time: Console.WriteLine(currentDateTime.ToString()); Console.WriteLine(); //Result: Print static method Now(), Time now: Console.WriteLine(Time.Now()); }
public static Time Now() { Time time = new Time(DateTime.Now); return time; }