Skip to main content
udhayak0001
April 25, 2023
Question

Return the last date of the current year

  • April 25, 2023
  • 6 replies
  • 0 views

Hi All,

Is there any function that returns the last date of the current year 

Thanks in Advance

    6 replies

    April 25, 2023

    date(year(today()), 12, 31)

    udhayak0001
    April 25, 2023

    Thanks Sanchit

    harshitb6843
    April 25, 2023

    Won't it always be 31st December?

    udhayak0001
    April 25, 2023

    Yes . But i was afraid to go with the hard coded value[emoticon:98f842990f454422aa6a04953955f9d9]

    stewart.burchell
    April 25, 2023

    Put the value in a constant. You can name it meaningfully e.g. XXX_LAST_DATE_OF_CURRENT_YEAR so your code is readable, and you can reference it in multiple places. It's never not going to be 13st December so, yes it's a fixed value but bets practice is to put into a constant.