How to calculate the day of the year

JPSS
Tera Contributor

How to calculate the day of the year

 

 

like 

 

 

Today Tuesday October 24, 2023 is ...
Day 297

 

11 REPLIES 11

@JPSS if your issue is resolved, please mark an answer Correct. This way the thread will be closed and it will help other users too. Also, this is a good practice to say Thank you to someone who has invested time to help you. 

abhishek_s
Tera Contributor

In case anyone is looking for brevity, the below gets the job done -

gs.print(Math.ceil(gs.dateDiff(gs.beginningOfThisYear(), gs.nowNoTZ(), true) / 3600 / 24));