Gabriele Petrioli please read my question before you close it.
my reports in SQL are daily, and INT as Date is perfect, two years ago I test Azure CosmosDB and I was able to convert by using JavaScript I did it by using UDF I just needed now for a project and bad luck, can't believe so many people are involved to downplay questions and administrating without programming skills and "managing", I will do it again I will not give up but I need the code today. I will post the solution if the managers did not close my question again.
here the original question:
I need to convert INT date produced by SQL into a Date using javascript.
I know this is possible I did it before I have a terrible day today and the time is clicking.
Here is the process: I convert the date to INT using SQL
select 'cast(getdate() as int)'
select cast(getdate() as int)
-- today 43811
I need to bring it back using Javascript. No Jquery or else.
--more exaples
select 'cast(40702 as smalldatetime)'
select cast(40702 as smalldatetime)
--output 2011-06-10 00:00:00
select 'cast(getdate() as float)'
select cast(getdate() as float)
-- output 43810.6597960262
Again I need to use JavaScript
convert2date(40702) --> 2011-06-10
convert2date(43811) --> 2019-12-14