Announcements
No record found.
Hi,
I want to convert Today's date into Yesterday date using X++.
For E.g : Today - 10/09/2019 to Yesterday - 10/08/2019.
Kindly suggest here.
Thanks and Regards,
Vignesh
static void Job23(Args _args)
{
TransDate transDate = today();
;
transDate++;
print transDate - 2;
pause;
}
Hi Vignesh,
Besides that, you can use addDays(date,-1);
utcDateTime todayLessOneDay, // Get the actual UTCDateTime based on the current system todaysDateTime = DateTimeUtil::utcNow(); // Convert it to a string, just to show in on the info log info(DateTimeUtil::toStr(todaysDateTime)); // Now less a day todayLessOneDay = DateTimeUtil::addDays(todaysDateTime, -1); // And Info it out again info(DateTimeUtil::toStr(todayLessOneDay));
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 616
André Arnaud de Cal... 460 Super User 2026 Season 1
Syed Haris Shah 331 Super User 2026 Season 1