Converting Julian dates

By Augusto Goncalves

The easiest way to convert a Julian date into day, month, year, hour and minutes format is to use of the AcDbDate class. Also, visit this post for more information.

struct resbuf rDate;

double time, fpart, ipart;

acedGetVar(_T("DATE"), &rDate);

time = rDate.resval.rreal;

fpart = modf (time, &ipart);

 

AcDbDate testDate;

testDate.setJulianFraction(fpart);

acutPrintf(_T("\nMinute: %d\nSec: %d\nMilisec: %d"),

  testDate.minute (),

  testDate.second (),

  testDate.millisecond ());


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading