MS_DOY2MD(3)

✨ MS_DOY2MD ✨

okay bestie, welcome to ms_doy2md πŸ’– β€” it lives in <libmseed.h> and it's literally just here to do calendar math for you so you don't have to. Converting between "day of year" and "month + day of month"? That's it. That's the whole vibe. No cap.


🌸 SYNOPSIS 🌸

#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 );

Two little icons, both in the same header, both returning an int. iykyk 🫢


πŸ’… DESCRIPTION πŸ’…

ms_doy2md takes a year and a day of year (jday) and works out the month and the day of month (mday) for you. it's giving "what day is it actually, on the calendar". πŸ—“οΈβœ¨

ms_md2doy does the opposite glow-up: give it a year, a month and a day of month (mday), and it hands you back the day of year (jday). main character energy in reverse. πŸ¦‹

for both routines, here's the tea on the expected and resulting ranges for every value β€” memorize these, fr fr:

  • year β€” 1900 – 2100
  • jday β€” 1 – 366
  • month β€” 1 – 12
  • mday β€” 1 – 31

and one tiny detail that matters SO much: a day of year of 366 corresponds to the last day of a leap year. 🐸✨ so don't come for the 366 unless the year deserves it.


πŸ‘‘ RETURN VALUES πŸ‘‘

  • ms_doy2md returns 0 on success and -1 on error.
  • ms_md2doy returns 0 on success and -1 on error.
okay so both of them are giving "0 means slay, -1 means we're not okay". check your return values, bestie, always. 😭

πŸŽ€ AUTHOR πŸŽ€

Chad Trabait IRIS Data Management Center


Libmseed API Β· 2004/11/22 β€” that's the source, the version vibe and the date, mwah πŸ’‹ thanks for coming to my ted talk, go convert some days πŸ§šπŸ’œ