Simple Question: Addhours

0
Hello, I'm trying to add a duration to a Start Date to produce an End Date. (Meeting starts at 12:00, duration = 2 hours, End Date should show 14:00) Looking in the API, I could find the following Xpath: addHours(dateTime($.../StartDate), $.../Duration) Where Start Date is Date and time, and Duration is Integer. Entering this in the Xpath, it returns the following error: Line: 1 Column: 10 Error: The function 'dateTime' takes one to seven literal Integers. I'm fairly new to Mendix, so it's probably something simple. Kind Regards,
asked
1 answers
3

Brent,

The example for addHours in the documentation is as follows: addHours(dateTime(2007, 1, 1, 1, 1, 1), 25)

However, in your case, it seems like you have an attribute that is already a datetime value, lets call it $Meeting/StartDate. So for this, you would use addHours as follows: addHours($Meeting/StartDate, 2) This would add 2 hours to the start date. the dateTime(2007, 1, 1, 1, 1, 1) function call will take those integer arguments and return a date (Jan 1 2007 in this case.

Hope that helps,

Mike

answered