Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Time conversion on Production is different in UAT and dev box

Posted on by
In API integration, I am generating JWT token in that, time is used as iat converted in epoch time.
 
 
I am trying to get epoch time in d365 finance and operations. while i try to convert it in Dev machine it is working fine, but in production server it is giving wrong time also in UAT server it is not giving the correct output.
I  have set same timezone for user in both Production , UAT and Dev box
below is the code:
internal final class EpochTime
{
    public static void main(Args _args)
    {
        System.DateTime dateTime2 = DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::utcNow(), DateTimeUtil::getUserPreferredTimeZone());
        str epochTime = any2str(EpochTime::getUnixTime(dateTime2));
        Info(epochTime);
    }
    public static int64 getUnixTime(System.DateTime dateTimeValue)
    {
        return new System.DateTimeOffset(dateTimeValue).ToUnixTimeSeconds();
    }
}
 
 
  • Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    Time conversion on Production is different in UAT and dev box
    Please tell us what you mean by wrong time. For example, is it off by a few hours?
     
    Have you already tried to debug the code in UAT? If so, what have you found? If not, it maybe the next logical step.
     

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans