fork download
  1. using static System.Console;
  2. using System;
  3.  
  4. public class Program {
  5. public static void Main() => WriteLine(DateTime.Now.ToTimestamp());
  6. }
  7.  
  8. public static class DateTimeExt {
  9. public static readonly DateTime TimeStampStart = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
  10. public static long ToTimestamp(this DateTime value) => (long)(value - TimeStampStart).TotalSeconds;
  11. }
  12.  
  13. //https://pt.stackoverflow.com/q/124769/101
Success #stdin #stdout 0.03s 17796KB
stdin
Standard input is empty
stdout
1577460611