Wednesday, 4 January 2023

Display max end time of the day using X++

 

In this post we will see how we can display a maximum end time of the day. For instance if I want to show the max end time of today which will be 11:59:59 PM. We can use newDateTime() method of DateTimeUtil class and will use the seconds to adjust our time.

 

MyTable myTable;
TimeOfDay secondsElapsed;
secondsElapsed = 86399;

myTable.ToDateTime = DateTimeUtil::newDateTime(DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()),secondsElapsed);

 

This will result you the system date with end time 11:59:59PM.

No comments:

Post a Comment

Filtering Company-Specific Product Templates - SysRecordTmpTemplate lookup

Hi Techies - Recently I have come across a requirement where I needed to display product templates specific to a selected company for a give...