fork download
  1. using System;
  2.  
  3. namespace TesteData {
  4. public class Program {
  5. public static void Main(string[] args) {
  6. var dataAtual = DateTime.Now.Date;
  7. var qtdDias = 5;
  8. var novaData = dataAtual.AddDays(-qtdDias);
  9. Console.WriteLine(novaData);
  10. }
  11. }
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/237114/101
Success #stdin #stdout 0.03s 18140KB
stdin
Standard input is empty
stdout
6/10/2020 12:00:00 AM