awk: support du format dd/mm/yy

This commit is contained in:
Jephté Clain 2017-10-12 21:03:59 +04:00
parent 312c7dcc1b
commit ab8ede8c28
1 changed files with 6 additions and 0 deletions

View File

@ -1883,6 +1883,12 @@ function __parse_date_fr(date, parts, y, m, d) {
m = int(parts[2])
d = int(parts[1])
return mktime(sprintf("%04i %02i %02i 00 00 00 +0400", y, m, d))
} else if (match(date, /([0-9][0-9]?)\/([0-9][0-9]?)\/([0-9][0-9])/, parts)) {
basey = int(strftime("%Y")); basey = basey - basey % 100
y = basey + int(parts[3])
m = int(parts[2])
d = int(parts[1])
return mktime(sprintf("%04i %02i %02i 00 00 00 +0400", y, m, d))
}
return -1
}