Skip to content

Instantly share code, notes, and snippets.

@j05u3
Created August 18, 2023 15:25
Show Gist options
  • Save j05u3/fa8ddd3b2060b302a55fec21a386076d to your computer and use it in GitHub Desktop.
Save j05u3/fa8ddd3b2060b302a55fec21a386076d to your computer and use it in GitHub Desktop.
void main() {
final DateTime fechaActual = DateTime.now();
for (var i = 17; i <= 20; i ++) {
final DateTime fechaInicioRetos = DateTime(2023, 8, i);
final int diferenciaDias = fechaActual.difference(fechaInicioRetos).inDays;
print(diferenciaDias.toString());
}
// Ouput when run on August 18th 10am:
// 1
// 0
// 0
// -1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment