fork(2) download
  1. using System;
  2. using System.Globalization;
  3.  
  4. namespace ProgramConsole
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. string s = "2005";
  11. DateTime dt;
  12. if(DateTime.TryParseExact(s, "yyyy", CultureInfo.InvariantCulture,
  13. DateTimeStyles.None, out dt))
  14. {
  15. Console.WriteLine(dt);
  16. }
  17. }
  18. }
  19. }
Success #stdin #stdout 0.05s 33896KB
stdin
Standard input is empty
stdout
1/1/2005 12:00:00 AM