I'm looking for the equivalent, or similar, functions to CALCDATE in order to manipulate either a DATETIME or TIME. Is there anything in C/AL to do so? I've searched for "Add Date" and "Add Time", but I've not turned up anything yet. The docs aren't much help. Under TIME, it just has a definition of the TIME type, or the TIME function. DateTime has even less info...
0
Comments
You can use:
MyTime := TIME + 100000
to add one minute to the current time.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
This one looks about right
DateTime := CREATEDATETIME(NewDate, NewTime);
I should think you could calculate the difference between two date times and just add it to the Datetime field.
I think its something like this but it was several years ago:
DateDiff := ((ToDate+ToTime)-(FromDate+FromTime));
Others
Date := DT2DATE(Datetime);
Time := DT2TIME(Datetime);
Sorry Not read the original post properly Ignore this reply
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I tried your solution... It didn't work... #-o
The right solution is:
MyTime := TIME + 600000 to add one minute to the current time.
Resuming:
1 min - 600000
1 hour - 3600000
12 hours 43200000
.....