web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Conveting DateTime format to TimeStamp format in business central

(0) ShareShare
ReportReport
Posted on by 115

Hi, How can I convert DateTime format to UnixTimestamp:BigInteger  in business central ?

thanks

I have the same question (0)
  • Suggested answer
    keoma Profile Picture
    32,729 on at

    calc the difference between the datetime and 1/1/1970 in seconds. thats then the unix timestamp.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,245 Super User 2025 Season 2 on at

    Are you using OnPrem or on Saas? because for OnPrem you have functions in Type Helper or DateTime offset codeunit but they are DotNet and works only in OnPrem.

  • MohitMalik8085 Profile Picture
    100 on at

    HI Faran,

    I hope you get your solution some how. could you please help me for the same thing like, I want to get the timestamp for the current datetime. it would be very much appriciate if you can give me some idea for the same how I can achieve the same. 

    Thanks in Advance :) 

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    Maybe this can help you:

    andreilungu.com/.../

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    And also this maybe:

    github.com/.../6663

  • Smart App Business Solutions Pty Ltd Profile Picture
    10 on at

    procedure GetUtcDateTime(sourceDateTime: DateTime) UtcTime: BigInteger;

       var

           TempTime: Text;

       begin

           TempTime := Format(sourceDateTime, 0, 9);

           TempTime := DelChr(TempTime, '=', '-:.TZ');

           Evaluate(UtcTime, TempTime);

       end;

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans