0

Add 3 months to an existing date and time field

How can I create a function field to add 3 months to an existing date and time field

5 replies

null
    • Leonid_Semik
    • 5 yrs ago
    • Reported - view

    Hi,

    as a formula field:

    ---

    date(year(date('date and time field')), month(date('date and time field')) + 3, day(date('date and time field'))) + time('date and time field')

    ---

    if you want to change the field, then as a button:

    ---

    'date and time field':=date(year(date('date and time field')), month(date('date and time field')) + 3, day(date('date and time field'))) + time('date and time field')

    ---

    Leo

    • bianca_lazare
    • 5 yrs ago
    • Reported - view

    Hi Leonid,  Thank you.  I have used the code you sent and its working perfectly now.  Regards Bianca

    • Be Legal Property Compliance
    • Katie_Rayner
    • 4 yrs ago
    • Reported - view

    This worked perfectly for me too thanks!  I created a button and was able to roll an annual subscription date to 365 days later by clicking a button :)

    'ANNUAL SERVICE EXPIRY' := date(year(date('ANNUAL SERVICE EXPIRY')), month(date('ANNUAL SERVICE EXPIRY')), day(date('ANNUAL SERVICE EXPIRY'))) + 365

    • Leonid_Semik
    • 4 yrs ago
    • Reported - view

    ANNUAL SERVICE EXPIRY' := date(year(date('ANNUAL SERVICE EXPIRY'))+1, month(date('ANNUAL SERVICE EXPIRY')), day(date('ANNUAL SERVICE EXPIRY'))) 

     

    Leo

    • carabooks
    • 3 yrs ago
    • Reported - view

    I'm missing something about this (not surprising, as I'm a complete codeless newbie). I have a "Date received" field and am trying to calculate a "Deadline" field four months later, but it's returning a number, not a date. In my sample record, "Date received" contains "Dec 9, 2020" and the "Deadline" formula is returning "1617940800000". I originally had "Deadline" as a date field, so I recreated it as a formula field. What am I doing wrong? Many thanks in advance.

    date(year(date('Date received')), month(date('Date received')) + 4, day(date('Date received'))) + time('Date received')

Content aside

  • 3 yrs agoLast active
  • 5Replies
  • 2384Views