Monday, August 5, 2019

AX - How to work with time zone

This example shows actual hour:

First row is actual time; second row is shifted to user predefined time zone; third row is shifted to specific fixed time zone.
info( int2str( DateTimeUtil::hour( DateTimeUtil::getSystemDateTime() ) ) );
    
info( int2str( DateTimeUtil::hour( 
  DateTimeUtil::applyTimeZoneOffset( DateTimeUtil::getSystemDateTime(), 
  DateTimeUtil::getUserPreferredTimeZone() ) ) ) );

info( int2str( DateTimeUtil::hour( 
  DateTimeUtil::applyTimeZoneOffset( DateTimeUtil::getSystemDateTime(), 
  Timezone::GMTPLUS0100_AMSTERDAM_BERLIN_BERN_ROME ) ) ) );
Output:
7
9
9

No comments:

Post a Comment