开发者

OLE date (number) to date (string)

开发者 https://www.devze.com 2023-02-11 01:55 出处:网络
I am debugging an application that I ported from Windows开发者_Go百科, to *nix, a little while ago. The app stores dates as doubles (using the OLE Date format). I need to be able to inspect the dates

I am debugging an application that I ported from Windows开发者_Go百科, to *nix, a little while ago. The app stores dates as doubles (using the OLE Date format). I need to be able to inspect the dates - as human readable strings. I cant find an online conversion tool, so I decided to roll my own.

I was originally going to write an OpenOffice function, but I think it would be more straightforward to use one of the .Net languages, to write a small console app that accepts the double as a parameter and prints the date string to the console.

I am relatively new to .Net (though I have dabbled with both C# and VB.Net in the past). Can anyone help with my main() function? - snippets in either VB.Net or C# will be equally useful.


try using DateTime.FromOADate([double])

0

精彩评论

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