vb6 DateSerial to C# Equivalent

webbiz

Member
Joined
Oct 15, 2011
Messages
21
Programming Experience
10+
I'm converting old VB6 code to C# which I'm a newbie.

lTempDays = Int(DateSerial(Year(startdate) + increment, Month(startdate), Day(startdate)))


In C# variables we have:

long lTempDays;
(increment passed as long)
(startdate passed as string)

DateTime date = Convert.ToDateTime(startdate);

I know I can get date.Year, date.Month and date.Day to pass to a DateSerial type method.

But what is the DateSerial equivalent to vb6 DateSerial to do the above and assign to lTempDays?

Thanks.
 
Back
Top Bottom