开发者

VB6 Julian Date String to Date Object

开发者 https://www.devze.com 2023-02-05 10:56 出处:网络
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 objec开发者_StackOverflow中文版t?

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 objec开发者_StackOverflow中文版t?

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

THanks.


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)
0

精彩评论

暂无评论...
验证码 换一张
取 消