day of year: descendant, ascendant

Microsoft Windows
Post Reply
Arnold
Posts: 4
Joined: 2022-Feb-26, 9:50 am

day of year: descendant, ascendant

Post by Arnold »

Hello Sir

Pls
How work day of year: descendant, ascendant. individuelle

- date 01.13.2024 = day of year is 13. This is okay for me!

but how scripte:
- 365 ( or 366) - 13 = 352

Thanks for your help
Arnold
User avatar
Simon Sheppard
Posts: 190
Joined: 2021-Jul-10, 7:46 pm
Contact:

Re: day of year: descendant, ascendant

Post by Simon Sheppard »

Code: Select all

$mydate = get-date
$year = ($mydate).year
$dayofYear = get-date -uformat "%j"

$days = 365
if ([datetime]::IsLeapYear($year)) {$days = 366}

Echo "Days in Year= $days"
Echo "Day of year= $dayofYear"
Echo "Diff= $($days-$dayofYear)"
Days in Year= 366
Day of year= 13
Diff= 353
Arnold
Posts: 4
Joined: 2022-Feb-26, 9:50 am

Re: day of year: descendant, ascendant

Post by Arnold »

Sir, your help is fantastique for me

Many thanks, all is Okay!

Arnold
Post Reply