I was working on some date related functionality the other day during
which I discovered some really useful date functions in X++. Some of
you might be familiar with some of this already, however it is always
good to have a blog post out there that lists them all for future
reference. I have also added sample code for the usage of each function.
Initialization
A date variable can be initialized with a date constant. The date
literal in X++ has a predefined format i.e. dd\MM\yyyy. Note that
backslash is used instead of forward slash and unlike string constants
neither single nor double quotes is used.
transDate = 01\01\2015;
today
Returns the date of the machine on which the code is run.
transDate = today();
systemDateGet