Ad Widget

Collapse

Caculating Today's Date, Plus 90 Days

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stevensedory
    Junior Member
    • Jan 2017
    • 9

    #1

    Caculating Today's Date, Plus 90 Days

    Hello, we are trying to create some triggers that will let us know when a warranty is to expire in 90 days.

    An example of the trigger expression I've tried, an many like it, is

    Code:
    {Event Tracking:system.localtime.time()}+90d<=20200425
    But it's not working. There must be a way to do this. Your help is appreciated.
  • stevensedory
    Junior Member
    • Jan 2017
    • 9

    #2
    I will try that thanks!

    Comment

    • stevensedory
      Junior Member
      • Jan 2017
      • 9

      #3
      So no go.

      I guess it might be better to ask it this way:

      Is there a way to make a simple trigger that will go off when a set date is 90 days ahead?

      We'd like to set some "Warranty expires in 90 days" triggers, but can't figure out how.

      Comment

      • stevensedory
        Junior Member
        • Jan 2017
        • 9

        #4
        Thanks splitek. Here's what I end up doing last night:

        I made an item with this key, and Units set to "s"
        Code:
        system.run[date "+%s" -d "{$WARRANTY_EXPIRATION}"]
        In Macros, I created {$WARRANTY_EXPIRATION}, and the details say "Date of warranty in MM/DD/YYYY format"

        I have another Item, a Calculated Item, "eppwarr.diff" that does this
        Code:
        last(system.run[date "+%s" -d "{$WARRANTY_EXPIRATION}"])-last(system.localtime)
        Then my Trigger Expression is this
        Code:
        {Event Tracking - Warranty:eppwarr.diff.last()}/60/60/24<90
        I didn't know about the system.run item. Love it!

        Comment

        Working...