Hi guys,
I need to know how Navision calculates date and time from a decimal field. The problem is that i don't need to do it on C/AL, but i just need to know the criteria.
This is my field :
"Starting Date-Time" (Data Type = Decimal,AutoFormatType = 10, AutoFormatExpr='DATETIME').
Checkin it out with Tools -> Zoom it says : 63.333.331,070033
Checkin it out with RUN it says : 14/12/06 15.57.50
Taking a look at codeunit 416 (Datetime Mgt.)
Datetime2Date(Datetime : Decimal) : Date
IF Datetime = 0 THEN
EXIT(0D);
EXIT(01010000D + ROUND(Datetime/86.400,1,'<'));
and then :
Datetime2Time(Datetime : Decimal) : Time
IF Datetime = 0 THEN
EXIT(0T);
EXIT(000000T + (Datetime MOD 86.400) * 1000000);
But what's the value inside 01010000D ? I mean, copying my field to Excel, which kind of operation do i need to do ?
Hope i was clear enough... thank you in advance guys.
Franco
0
Comments
Datetime/86.400 is number of days since 1.1.0000. To get date you need to add the number of days to some base date (01010000D) to get new date.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
PS: any suggestions about how to have the right date using Excel ?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.