Search code examples
datetimefoxprovisual-foxpro

DATETIME plus Minutes from table


How do you add minutes to a DATETIME field?

08/12/2013 11:00:00 PM + 120 minutes

Solution

  • You can just use the add (+) symbol but the value is added in seconds.
    120 minutes is 7200 seconds.

    NewDateTime = OldDateTime + 7200
    

    Or, for coding clarity as pointed out by Tamar:

    NewDateTime = OldDateTime + (120 * 60)