Skip to main content
udhayak0001
Inspiring
Apr 25, 2023 9:12 AM UTC
Question

Return the last date of the current year

Hi All,

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

Thanks in Advance

    6 replies

    sanchitg0002
    Inspiring
    Apr 25, 2023 9:18 AM UTC

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

    udhayak0001
    Inspiring
    Apr 25, 2023 9:51 AM UTC

    Thanks Sanchit

    harshitb6843
    Brainy
    Apr 25, 2023 9:40 AM UTC

    Won't it always be 31st December?

    udhayak0001
    Inspiring
    Apr 25, 2023 9:52 AM UTC

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

    stewart.burchell
    Employee
    Apr 25, 2023 10:17 AM UTC

    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.