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

convert Date To decimal

(0) ShareShare
ReportReport
Posted on by 5

hello i want to convert DateTime to decimal my problem when i click he put the date of today i want changed TODAY to ALL days or any date 

can you help me please this is my function DateTime Todecimal 

ServLaborAllocationEntry."Start Date-Time":=DateTimeToDecimal(TODAY,TIME,'UTC');

LOCAL DateTimeToDecimal(date : Date;time : Time;timeZoneCode : Code[10]) decimalDate : Decimal
IF (date = 0D) THEN
EXIT(0);

IF time = 0T THEN
EXIT((date-01010000D) * 86.4 - L_TZDiff*3.6)
ELSE
EXIT(((date-01010000D) * 86.4) + (time - 000000T)/1000000 - L_TZDiff*3.6);

  • Suggested answer
    THE Italian Profile Picture
    THE Italian on at
    RE: convert Date To decimal

    Use Codeunit 10 TypeHelper.

    There is a vast plethora of useful functions that could help you achieve what you need.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans