Page 1 of 1

day of year: descendant, ascendant

Posted: 2024-Jan-13, 11:41 am
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

Re: day of year: descendant, ascendant

Posted: 2024-Jan-13, 2:38 pm
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

Re: day of year: descendant, ascendant

Posted: 2024-Jan-13, 4:08 pm
by Arnold
Sir, your help is fantastique for me

Many thanks, all is Okay!

Arnold