fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. DateTime fecha = new DateTime(2013, 3, 22, 19, 13, 31);
  8.  
  9. // Round-trippable: o
  10. Console.WriteLine(fecha.ToString("o"));
  11.  
  12. // Estándar RFC 1123: r, R
  13. Console.WriteLine(fecha.ToString("r"));
  14.  
  15. // ISO 8601, ordenable: s
  16. Console.WriteLine(fecha.ToString("s"));
  17.  
  18. // Ordenamiento universal: u
  19. Console.WriteLine(fecha.ToString("u"));
  20.  
  21. // UTC: U
  22. Console.WriteLine(fecha.ToString("U"));
  23. }
  24. }
Success #stdin #stdout 0.11s 24200KB
stdin
Standard input is empty
stdout
2013-03-22T19:13:31.0000000
Fri, 22 Mar 2013 19:13:31 GMT
2013-03-22T19:13:31
2013-03-22 19:13:31Z
Friday, March 22, 2013 7:13:31 PM