Velocity Script: Retrieve only date values from a "datetime" type of a Custom Object field
Hi,
Using Velocity Script, how can I separately retrieve Date, Month and Year values from a datetime field from a custom object?
Example:
We want to send a weekly email to those who complete at least one course in the last week. The third party integration sends data to Marketo every Sunday and the email should go out in 1 hour of sync to those who completed the course.
We want to create a velocity script for this case to run auto-sending email every week (without any manual date updates in the script). We have below 2 questions:
1)
Seems like we would need to compare 2 datetime fields, while ignoring timestamp values.
- "updated at" field in the CO - which captures the time when the sync occurs; and
- system datetime
2)
We need to run a one-time email to catch up with the previous users who completed course/s. Here, we would need to compare 2 datetime fields, again, while ignoring timestamp values.
- "updated at" field in the CO - which captures the time when the sync occurs; and
- specific past date
I am looking for code samples for this.
TYIA