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β2100jdayβ1β366monthβ1β12mdayβ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_doy2mdreturns0on success and-1on error.ms_md2doyreturns0on success and-1on 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 π§π
π¦ where this page comes from
- debian bookworm: libmseed-doc 2.19.8-1 Β· LGPL-3.0-or-later
- debian trixie: libmseed-doc 2.19.8-1 Β· LGPL-3.0-or-later
- fedora 43: libmseed-devel 2.19.5-21.fc43 Β· LGPL-3.0-or-later
- fedora 43: libmseed-devel 2.19.5-21.fc43 Β· LGPL-3.0-or-later
- fedora 44: libmseed-devel 2.19.5-22.fc44 Β· LGPL-3.0-or-later
- fedora 44: libmseed-devel 2.19.5-22.fc44 Β· LGPL-3.0-or-later
- ubuntu jammy: libmseed-doc 2.19.6-3 Β· LGPL-3.0-or-later
- ubuntu noble: libmseed-doc 2.19.8-1ubuntu2 Β· LGPL-3.0-or-later
- ubuntu questing: libmseed-doc 2.19.8-1ubuntu2
- ubuntu resolute: libmseed-doc 2.19.8-1ubuntu3 Β· LGPL-3.0-or-later
- ubuntu stonking: libmseed-doc 2.19.8-1ubuntu3 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms