Thursday, July 18, 2019

How to Get Start Date and End Date from a Date (SystemDateGet())

How to  Get Start Date and End Date from a Date

utcDateTime fromDateTime,toDateTime;

fromDateTime= DateTimeUtil::newDateTime((DateStartMth(SystemDateGet())),str2time("00:00:00.000 AM"),DateTimeUtil::getUserPreferredTimeZone());


    toDateTime= DateTimeUtil::newDateTime((endmth(SystemDateGet())),str2time("23:59:59.000 PM"),DateTimeUtil::getUserPreferredTimeZone());

You can build a date range where fromDateTime is starting date of a month and toDateTime is ending date of a month.

Thanks
Uma

No comments:

Post a Comment

Get Enum Id and Enum Value in D365FO using SQL and X++

 Below is the sql get enum id and enum value of a enum in D365 F&O using sql. SELECT   enumidtable . NAME           'Enum Name' ...