Attribute - Date

Transaction/Purchase date.

Profile : currentTxns (Current Transaction)
Attribute: date
Sub-Attribute: dateDiff, day, dayOfMonth, daysDiff, daysDiffFromString, isAfter, isHourBetween, isTimeBetween, isValid, isWeekday, isWeekend, month, and year
Data Type: date
Meaning: date of transaction
Syntax: currentTxn.

ProfileAttributeSub-AttributeDescription and Example
currentTxndatedatediffdateDiff - absolute difference between 2 dates e.g. currentTxn.date.dateDiff(currentTxn.date)==0
currentTxndatedayday - day of the week, week starts on Sunday as 1 e.g.Tuesdays would be currentTxn.date.day( )==3
currentTxndateisWeekdayisWeekday - checks if the date is a weekday e.g. currentTxn.date.isWeekday( )
currentTxndateisWeekendisWeekend - checks if the date is a weekend e.g. currentTxn.date.isWeekend( )
currentTxndateisValidisValid - simply checks if a valid date is present in that field e.g. currentTxn.date.isValid( )
currentTxndateisAfterisAfter - checks if the attribute occurs after a defined date-time e.g. currentTxn.date.isAfter(YYYY,MM,DD,HH,MM,SS)
currentTxndateisHourBetweenisHourBetween - scenarios like happy hours. hour in 24 hour format e.g. currentTxn.date.isHourBetween(HH,HH)
currentTxndateisTimeBetweenisTimeBetween - similar to happy hours, but when minutes also matter e.g. currentTxn.date.isTimeBetween(HH,MM,HH,MM)
currentTxndatedayOfMonthdayOfMonth - date of the month e.g. For offers on the first 5 days of each month
currentTxndatedaysDiffdaysDiff - same as dateDiff, but ignores the year. Useful for anniversary type promotions.
currentTxndatedaysDiffFromStringdaysDiffFromString - same as daysDiff, but when you want to use an attribute that could be saved as a string
currentTxndateminutesDiffminutesDiff - absolute difference similar to dateDiff, but looks at minutes
currentTxndateMonthmonth - month number is returned
currentTxndateYearyear - returns the year from the date e.g. currentTxn.date.year( )>=198
Examples: 1 Write a rule to check that the difference between current Transaction date and customer's join date is less than or equal to 7 days AND the Current Transaction value is greater than or equal to 250.
Rule: currentTxn.date.dateDiff(currentCustomer.joinDate)<=7&&(currentTxn.value>=250)
Example 2: Write a rule to check if the current Transaction is done on Wednesday or on Tuesday.
Profile: currentTxn
Attribute: date
Sub-Attribute: day
Value: week starts on Sunday as 1, Monday as 2, Tuesday as 3, Wednesday as 4, and so on.Rule: currentTxn.date.day( )==3||currentTxn.date.day( )==2
Example 3: Write a rule to check that the transaction is made after 5th July 2023, 12:00 AM and Transaction value is greater than or equal to 5000.
Rule :currentTxn.date.isAfter(2023,07,05,00,00,00)==true&&(currentTxn.value>=5000)