Convert Excel Julian to VB.NET Date

S

simchajoy2000

Hi,

I am reading some dates from an Excel worksheet in my VB.NET code and
even though in Excel these dates appear in this format 3/18/04, it is
read into my code as a number like this: 36903.

I have been told this is a Julian date but the calculations I have
found on the internet to handle the conversion gives me dates from 1938
- so either this isn't a Julian number or excel has it's own way of
calculating it.

Can someone help me? I really need to know how to convert this number
to a date.

Thanks!

Joy
 
P

Phill W.

I am reading some dates from an Excel worksheet in my VB.NET code and
even though in Excel these dates appear in this format 3/18/04, it is
read into my code as a number like this: 36903.

IIRC, Excel holds dates as days since 0-Jan-1900.
Experiment with putting numbers into Excel and formatting them as dates,
and vice versa.

BTW, I can't reproduce the values you gave above:
18-Mar-2004 => 38064
36903 => 12-Jan-2001

Regards,
Phill W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top