dmi_get_date(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 (peep enum dmi_field for the full menu πŸ‘€)
  • yearp β€” optional out parameter for the year, no pressure tho
  • monthp β€” 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:


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