How to get double from date?

DangDKhanh-2637 941 Reputation points
2022-01-21T16:27:01.19+00:00

Hi,
I have the following numbers:

int d=21, m=1, y=2022, h=0,m=0,s=0  

I can convert them to string with format as datetime "2022/1/21 00:00:00", then convert to double by code from this post

but this result=1642698000 is different from excel 44582.

Can I achieve this without MFC?
Thanks you.

167314-image.png

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,511 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 39,826 Reputation points
    2022-01-21T16:29:42.82+00:00

    Try this function -- VarDateFromStr


0 additional answers

Sort by: Most helpful