dmi_get_date(9)
π dmi_get_date β kernel API manual, but make it cute
okay so bestie, welcome to the dmi_get_date(9) page π this one lives in the Kernel API Manual and it's literally all about parsing a DMI date. yes, the BIOS-adjacent date thing. we're doing it, and we're slaying it β¨
πΈ NAME πΈ
dmi_get_date β parse a DMI date ποΈ
π SYNOPSIS π
bool dmi_get_date (int field , int *yearp , int *monthp , int *dayp );
π¦ ARGUMENTS π¦
fieldβ the data index, fr (peepenum dmi_fieldfor the full menu π)yearpβ optional out parameter for the year, no pressure thomonthpβ optional out parameter for the month πdaypβ optional out parameter for the day βοΈ
β¨ DESCRIPTION β¨
so the deal is: the date field is assumed to be in a form resembling [mm[/dd]]/yy[yy], and the result gets stored in the out parameters β any or all of which can be omitted. like, you do you, bestie π«Ά
if the field doesn't exist, all out parameters get set to zero and false is returned. no field, no date, no drama π
otherwise true is returned, with any invalid part of the date set to zero. lowkey forgiving, highkey useful.
and on return, you're guaranteed that year, month and day fall in the range of [0,9999], [0,12] and [0,31] respectively. periodt. those are the vibes and they are guaranteed π₯
π SEE ALSO π
kernel file ./drivers/firmware/dmi_scan.c, plus the whole friend group:
dmi_setup(9)dmi_matches(9)dmi_is_end_of_table(9)dmi_check_system(9)dmi_first_match(9)dmi_get_system_info(9)dmi_name_in_serial(9)dmi_name_in_vendors(9)dmi_find_device(9)dmi_get_bios_year(9)dmi_walk(9)dmi_match(9)dmi_memdev_type(9)dmi_memdev_handle(9)
ngl this one's short and sweet β but the ranges and the false-on-missing-field thing are the parts you actually need to remember, so don't skip those π§
okay that's the page!! this lil manual moment came from ./drivers/firmware, dated October 2026 π mwah, go parse some dates bestie π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms