web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Smart App Business Solutions Pty Ltd Profile Picture
    10 on at
    RE: Conveting DateTime format to TimeStamp format in business central

    procedure GetUtcDateTime(sourceDateTime: DateTime) UtcTime: BigInteger;

       var

           TempTime: Text;

       begin

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

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

           Evaluate(UtcTime, TempTime);

       end;

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,041 Moderator on at
    RE: Conveting DateTime format to TimeStamp format in business central

    And also this maybe:

    github.com/.../6663

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,041 Moderator on at
    RE: Conveting DateTime format to TimeStamp format in business central

    Maybe this can help you:

    andreilungu.com/.../

  • MohitMalik8085 Profile Picture
    100 on at
    RE: Conveting DateTime format to TimeStamp format in business central

    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
    Suresh Kulla Profile Picture
    50,233 Super User 2025 Season 2 on at
    RE: Conveting DateTime format to TimeStamp format in business central

    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.

  • Suggested answer
    keoma Profile Picture
    32,729 on at
    RE: Conveting DateTime format to TimeStamp format in business central

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

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,132

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,615

#3
Sumit Singh Profile Picture

Sumit Singh 2,912

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans