Gnu AWK provides the built in function
strftime()
which can convert a timestamp like 1359210984
into Sat 26. Jan 15:36:24 CET 2013
.
I couldn't find a function that would do this:
seconds = timefromdate("Sat 26. Jan 15:36:24 CET 2013", "%a %d. %b %H:%M:%S CET %Y")
or
seconds = timefromdate("2013-01-26 15:36:24", "%Y-%m-%d %H:%M:%S")
Whereas seconds
then is 1359210984
.
So, the date string should be convertable by a format pattern.
I'd like to do this in gawk only.
Edit 1:
I'd like to convert the date only in gawk for further processing of the stream.
Edit 2:
I've clarified my question. It was a bit sloppy in the "would do this" code example.