While the community in here are happy to help people, be it simple or complex questions, the main objective is to help them help themselves. Amongst others, man pages are invaluable sources of info, e.g.
man date:
Quote:
FORMAT controls the output. Interpreted sequences are:
.
.
.
%s seconds since 1970-01-01 00:00:00 UTC
This would answer your first question: 1512363600 is the number of seconds since "the epoque", of that day's midnight.
2. question: how many seconds does an hour have? how many hours a day?
3.
man awk:
Quote:
7. Builtin-variables
.
.
.
NR current record number in the total input stream.
By default, lines are the records for
awk, so
NR==19 detects the 19th line (as requested)
Quote:
substr(s,i,n) / substr(s,i)
Returns the substring of string s, starting at index i, of length n. If n is omitted, the suffix of s, starting at i is returned.
so
substr($0,31,11) will extract exactly that part of the line that needs to be compared to your sample text.
I think the logics should be clear by now.