cancel
Showing results for 
Search instead for 
Did you mean: 

Dates in pipeline

smajor
New Contributor

Hi,

Im trying to write an if/and statement in SnapLogic. I need 2 dates to be compared to a third date. The issue is its turning my dates into a formula instead of recognizing it as a date. Any suggestions on how to get around this? I have it written out as 6/15/2017. I tried July 15, 2017 but that didn’t work.

1 REPLY 1

tstack
Former Employee

Can you include the expressions that you are trying? Are you using Date.parse() to convert the string into a Date object?

The following is working for me:

Date.parse("6/15/2017")

After you have the Date objects, you should be able to compare them with the usual comparison operators (e.g. less-than, greater-than, …). For example, to compare a date against the current time:

$mydate < Date.now() ? "past" : "future"