You might not be able to see it online,
but I am waggling my finger now
in disapproval.
Though you have managed to peep under the skirts
of the Clock.Now() routine and seen its hidden
internals, that is no cause to build a routine
based on what you saw today.
There is no assurance in the MIT docs that Clock.Now has
that format. It's entirely possible and reasonable for any
MIT dev to change that internal format at any time, as long as the external
formats and methods still work the same.
For the sake of your program's longevity and your own
development as a programmer, I say Math Up and find a
sequence of legitimate blocks that will :
- Get the formatted YYYY/MM/DD date from Now() (MM/DD/YYYY is okay too)
- Extract the current 4 digit year YYYY
- Build the date for New Years YYYY/01/01
- Convert that to an Instant
- Get the Duration from the New Years Instant to Now() in Milliseconds
- Calculate the number of Milliseconds in a day
- Divide the Duration by the Milliseconds per day number, and discard the fractional part
- Add one to get the day number.
ABG