Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

converting dates things from visual basic to c-sharp

So as an excercise in utility i've taken it upon myself to convert one of our poor old vb .net 1.1 apps to C# .net 4.0.

I used telerik code conversion for a starting point and ended up with ~150 errors (not too bad considering its over 20k of code and rarely can i get it to run without an error using the production source) many of which deal with time/date in vb versus c#.

my question is this how would you represent the following statement in VB

If oStruct.AH_DATE <> #1/1/1900# Then

in C#? The converter gave me

            if (oStruct.AH_DATE != 1/1/1900 12:00:00 AM) {

which is of course not correct but I cannot seem to work out how to make it correct.

like image 576
sinrtb Avatar asked Aug 29 '26 09:08

sinrtb


1 Answers

 if (oStruct.AH_DATE != new DateTime(1900, 1, 1){
like image 158
Amiram Korach Avatar answered Sep 01 '26 00:09

Amiram Korach