shithub: ircs

ref: e57fc06379d7784bf90fadc8ac4440e2d2b2270b
dir: /irctime/

View raw version
#!/bin/rc
# irctime: convert ircs timestamps to ISO 8601 format
awk '
BEGIN {
	mon["Jan"] = "01"
	mon["Feb"] = "02"
	mon["Mar"] = "03"
	mon["Apr"] = "04"
	mon["May"] = "05"
	mon["Jun"] = "06"
	mon["Jul"] = "07"
	mon["Aug"] = "08"
	mon["Sep"] = "09"
	mon["Oct"] = "10"
	mon["Nov"] = "11"
	mon["Dec"] = "12"
}
/^-- / {
	dd = $3
	mm = mon[$4]
	yyyy = $5
	next
}
{
	print yyyy "-" mm "-" dd "T" $0
}
' $*