The --time-format long option for dmesg is a possibility using the iso format:
(note the T and no space between the date and the time, due to the iso format)
The sed only works if you have a line with 2022-12-12T09 and a line with 2022-12-12T10 in your logs.
$ sudo dmesg --time-format=iso | sed -n '/2022-12-12T09/,/2022-12-12T10/p'
You could alternatively do something like this to add more specificity to the time range (here, we are grabbing only the specified minutes in the range):
In this one, you'd also need a line with 2022-12-12T09:16 and a line with 2022-12-12T09:24 in your logs.
$ sudo dmesg --time-format=iso | sed -n '/2022-12-12T09:16/,/2022-12-12T09:24/p'
From the manpage
--time-format format Print timestamps using the given format, which can be ctime, reltime, delta or iso. The first three formats are aliases of the time-format-specific options. The iso format is a dmesg implementation of the ISO-8601 timestamp format. The purpose of this format is to make the comparing of timestamps between two systems, and any other parsing, easy. The definition of the iso timestamp is: YYYY-MM-DDHH:MM:SS,<-+>.
The iso format has the same issue as ctime: the time may be inaccurate when a system is suspended and resumed.
dmesg? man7.org/linux/man-pages/man1/dmesg.1.html--time-formatoption in your dmesg version? It should be useful to know if you do it to can run this command and parse it correctly:sudo dmesg --time-format 'ctime'journalctlis also able to showdmesgmessages by usingsudo journalctl -k(but given that you say thatjournalctldoes not have the options--sinceand--untilthen this is not so useful)date -d $(dmesg -T --time-format iso | grep -w "oom-kill" | cut -d ',' -f 1) +%sto get the time of the log (in seconds from epoch) for doing comparison.