DOKK / manpages / debian 11 / libmseed-doc / ms_doy2md.3.en
MS_DOY2MD(3) Library Functions Manual MS_DOY2MD(3)

ms_doy2md - Convert between day of year and month and day of month

#include <libmseed.h>
int  ms_doy2md ( int year, int jday, int *month, int *mday );
int  ms_md2doy ( int year, int month, int mday, int *jday );

ms_doy2md calculates the month and day of month (mday) for a given year and day of year (jday).

ms_md2doy calculates the day of year (jday) for a given year, month and day of month (mday).

For both routines the expected and resulting ranges for each value are:

year  : 1900 - 2100
jday  : 1 - 366
month : 1 - 12
mday  : 1 - 31

A day of year of 366 corresponds to the last day of a leap year.

ms_doy2md returns 0 on success and -1 on error.

ms_md2doy returns 0 on success and -1 on error.

Chad Trabant
IRIS Data Management Center
2004/11/22 Libmseed API