Unfortunately, as you saw, gawk just can't do it directly. gawk manual says:
All well-known POSIX-compatible systems support time stamps from 0 to 2 ^ 31 - 1, which is enough to represent the time until 2038-01-19 03:14:07 UTC. Many systems support a wider range of timestamps, including negative timestamps that represent time before an era.
The manual does not indicate what strftime() does if a date is out of range.
But even on my system, which behaves reasonably for negative time_t values, the gawk strftime() function does not support them (although mktime() does), and therefore cannot process dates until 1970. I think this will be a mistake in gawk.
(My advice is to use Perl instead of Awk, but this does not answer the question you asked.)
Basically, you can invent the wheel by reimplementing a function like strftime() in awk. But that would be superfluous.
If your system has a GNU coreutils date working command, you can call it from gawk . Using your example January 1, 1960:
$ cat 1960.awk #!/usr/bin/awk -f BEGIN { timestamp = mktime("1960 00 00 00 00 00") print "mktime() returned " timestamp if (0) { # This doesn't work s = strftime("%Y-%m-%d %H:%M:%S", timestamp) print "strftime() returned ", s } else { # This works "date '+%Y-%m-%d %H:%M:%S' -d @" timestamp | getline t print "The date command printed \"" t "\"" } } $ ./1960.awk mktime() returned -318355200 The date command printed "1959-11-30 00:00:00" $
(I refused to figure out the sequence of quotes and backslashes needed for this, as a single-line font from the command line).
This probably makes sense if you have a large existing awk program and you need to add this function to it. But if you are not stuck with awk with this, you might consider using something else; awk may not be the right tool for what you are trying to accomplish.
Or, if you are truly ambitious, you can change the sources of gawk to handle this case correctly.