Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB6 Julian Date String to Date Object

Is there a function in Visual Basic 6 that can be used to convert a julian date string (99001-1st of Jan 1999) to a Date object?

I have tried using CDate() but the results are not as expected.

THanks.

like image 630
Koekiebox Avatar asked Dec 01 '25 15:12

Koekiebox


1 Answers

I think the following would work, just put your julian date inside the jd variable.

Dim dt as Date 
Dim jd as Long
dt = DateSerial(1900 + Int(jd / 1000), 1, jd Mod 1000)
like image 150
Hans Olsson Avatar answered Dec 03 '25 07:12

Hans Olsson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!