In keeping with tradition, I was able to find the answer in Emacs itself while asking this question.
It turns out the standard time functions work with different kinds of values:
Function arguments, e.g., the TIME argument to current-time-string
,
accept a more-general "time value" format, which can be a list of
integers as above, or a single number for seconds since the epoch, or
nil
for the current time. You can convert a time value into a
human-readable string using current-time-string
and
format-time-string
, into a list of integers using seconds-to-time
,
and into other forms using decode-time
and float-time
. These
functions are described in the following sections.
So, seconds-to-time
will do what's needed. Note that since (current-time)
returns microseconds as well – something not present in most UNIX timestamps – the assertion in the question won't hold as-written. If you strip microseconds from (current-time)
, though, they'll be the same :-)