Converting System.DateTime to JD Edwards Date

Posted by Christopher House on Geeks with Blogs See other posts from Geeks with Blogs or by Christopher House
Published on Fri, 28 May 2010 07:05:35 GMT Indexed on 2010/05/28 14:22 UTC
Read the original article Hit count: 569

Filed under:

As a follow up to my post the other day on converting a JD Edwards date to a .Net System.DateTime, here is some code to convert a System.DateTime to a JD Edwards date:

public static double ToJdeDate(DateTime theDate)
{
  double jdeDate = 0d;

  int dayInYear = theDate.DayOfYear;
  int theYear = theDate.Year - 1900;
  jdeDate = (theYear * 1000) + dayInYear;

  return jdeDate;
}

© Geeks with Blogs or respective owner