SunSetRiseLib icon indicating copy to clipboard operation
SunSetRiseLib copied to clipboard

NULL DateTime via getDateTime(double minutes, DateTime date)

Open drwison opened this issue 10 years ago • 0 comments

Hi, just a note on the getDateTime(double minutes, DateTime date) function: it returns null for negative minutes which may be incorrect. Depending on the timezone & location, negative minutes may be correct in which case the returned date should be on the previous day, something like: if (hour<0){ DateTime negDate = new DateTime(date.Year, date.Month, date.Day, 0, (int)minute, (int)second); return negDate.AddHours((int)hour); } Example would be determining sunrise in UTC for a location like Sydney, Australia,Tokyo etc.

Cheers Will

drwison avatar Jan 04 '15 06:01 drwison