Is it possible to convert date to OA date format?

studio

#1

is it possible to convert date to OA date format ?

because I want to compare my date to all the dates in excel, so when I read Range date column, it gives me all the OA dates, so if conversion of date to OA date is possible then it would be easy for me to simply convert my date into OA date and compare them.


#2

Hi @samir,
refer this link

https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tooadate?view=netframework-4.7.2


#3

Hi Samir,

Try this system.DateTime.FromOADate

I hope this helps

Regards
Srish


#5

hey @srishsai

Thanks buddy,
but what if I want to convert my date into OA date format,
because it would be easy for me to convert only my date and compare it to all the date I have from the excel (in OA date format)


#6

Dear @samir,

try this one
system.DateTime.Now.ToOADate

I hope this solves


#7

Try this one:
system.DateTime.Today.ToOADate.ToString


#8

hey, yeah it works… but instead of now i used Today to get OA date for date(05/02/2019).

Thanks,
Regards
Samir.


#9

yes!! got it. Thanks for the reply. :slightly_smiling_face:


closed #10

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.