Date Time issue

PROBLEM :yesterday i faced an issue . when fetching date from date effective framework it shows wrong date like the actual date is 2/1/2012 it shows one 1/1/2012  (date-1) ;

 

i use this code :

    date startDate, endDate;
utcDateTime startTime, endTime,asofDate;
startDate = str2Date(“31/12/1900”,123);
endDate = str2Date(“31/12/2054”,123) ;
asofDate    = DateTimeUtil::utcNow();
startTime = DateTimeUtil::newDateTime(startDate, 0);
endTime = DateTimeUtil::newDateTime(endDate, 0);

select validTimeState(startTime,endTime) * from hcmemployment
where hcmemployment.Worker == hcmworker.RecId;

info(strfmt(‘%1’,UTCdatetime::date(hcmemployment.validFrom)));

Solution :

this is because of utcdatetime issue

 

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s