Auteur Sujet: Trouver les 4 dimanche avant noël 2023  (Lu 4906 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne Arenas

  • Newbie
  • *
  • Messages: 17
  • Karma : 2
    • Voir le profil
    • http://arenas.pagesperso-orange.fr/GradientExample/france-countdown.html
Trouver les 4 dimanche avant noël 2023
« le: décembre 05, 2023, 10:18:50 am »
cls

#  trouver les 4 dimanche avant noël 2023
# PowerShell toute version

$year = get-date -Format yyyy   

    $cd = ([datetime]"12/25/$year").tooadate()   
    $array = 1..28 |% {   
if (($cd - $_) % 7 -eq 1){   
    [datetime]::fromoadate($cd - $_).tolongdatestring()
    }   
 }   

"1." +$array[3]   
"2." +$array[2]   
"3." +$array[1]   
"4." +$array[0]   

""

@r