fork(2) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. DateTime a = DateTime.Parse("2020/5/30 12:00:00 AM");
  8. DateTime b = DateTime.Parse("2020/5/30 08:30:00 AM");
  9. DateTime c = DateTime.Parse("2020/5/30 12:00:00 PM");
  10.  
  11. int result = DateTime.Compare(a, b);
  12.  
  13. Console.WriteLine(a);
  14. Console.WriteLine(b);
  15. Console.WriteLine(c);
  16. Console.WriteLine(result);
  17. result = DateTime.Compare(c, b);
  18. Console.WriteLine(result);
  19. }
  20. }
Success #stdin #stdout 0.03s 17644KB
stdin
Standard input is empty
stdout
5/30/2020 12:00:00 AM
5/30/2020 8:30:00 AM
5/30/2020 12:00:00 PM
-1
1