News:

  • May 30, 2026, 04:03:34 PM

Login with username, password and session length

Author Topic: Day of Year  (Read 5364 times)

RBPLC

  • Hero Member
  • *****
  • Posts: 586
Day of Year
« on: August 09, 2021, 06:52:18 PM »
Is there a structure member that will return the current day of the year without doing math? For example 1/1/21 = 1, 8/9/21 = 221.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3826
    • Host Engineering
Re: Day of Year
« Reply #1 on: August 09, 2021, 10:04:11 PM »
Sorry, no.

Fill in UDT0 with 1/1/$Now.Year.   0:00:00 (midnight Jan 1 of current year)
DT2EPOC UDT0 to D100
MATH D101 (DST21 - D100) / (24 * 3600)  // D101 contains number of full days since Jan1; add 1 if you want it to truncate up, i.e Jan 1 you want 1, not 0