March 20th, 2014, 05:49 PM
What is the equivalent of DateSerial (VB6) in C Sharp?
When I try to duplicate the results in C# that I get in VB6, it just does not come out the same (or even close).
Here is a snippet of VB6 code that I need to port over to C#.
The iYear = 1989, iMonth = 12, iDay = 18.
'Establish Julian date for this year and date
iYear = Year(dDate): iMonth = Month(dDate): iDay = Day(dDate)
fJulianDay0 = CDbl(DateSerial(iYear, 1&, 1&)) + 1.5
fJulianDate = CDbl(DateSerial(iYear, iMonth, iDay)) + 1.5
To solve for fJulianDay0 for the date of January 1, 1989, VB6 produces the result (32510.5).
To solve for fJulianDate for the date of December 18, 1989, VB6 produces the result of (32861.5).
I am unable to duplicate these results with C# and have been trying for weeks to solve this problem.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!