[ILUG] julian dates...

David Neary dneary at informix.com
Wed Sep 27 17:43:11 IST 2000


Hi,

libc solution would be to declare a tm struct, get your (Julian) date
into it, then use strftime() or asctime() to convert that to the format
you want.

So

struct tm timestruct;
char datestring[50];

timestruct.tm_year=year;
timestruct.tm_yday=juliandate;

ascftime(& datestring, "%D", timestruct);

fprintf(stdout, "%s", datestring);

would do the job.

Dave.


kevin lyda wrote:
> 
> so, using either a libc function or a perl function, how would one
> extract a date (day of month, month, year) from a julian date
> (year, day of year)?
> 
> kevin


-- 
		Dave Neary,
	Software engineer, Informix Dublin.
		Ireland.
	Phone: +353-1-409-1357




More information about the ILUG mailing list