Get Current Year Via Formula

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dodom2
    Senior Member
    • Jan 2020
    • 198

    Get Current Year Via Formula

    Hello.

    Can someone help me on this basic issue? Im trying to get the current year via formula. Below is what Im using

    name=datetime\year(VALUE);

    This did not work. It returns a 0.

    I have reviews the documentation here and can't seem to get it to return 2020.

  • item
    Active Community Member
    • Mar 2017
    • 1476

    #2
    Hello,

    VALUE must be a date/dateTime attribute (field name).
    you have this to : datetime\now()

    so just need to format : datetime\format(datetime\now(), 'America/New_York', 'YYYY');
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    • dodom2
      Senior Member
      • Jan 2020
      • 198

      #3
      Thank You item ! That works

      Comment

      Working...