datetime - How to re-calculate the time-stamps (from the past) to UTC using bash -
i have text file (data.txt) contains time-stamps expressed in local time-zone (cest):
example:
2015-05-13 23:12:11 2015-05-14 00:13:23 2015-05-14 07:12:13 2015-05-14 08:34:45 2015_05-14 19:39:44
i have write bash script re-calculates these time-stamps utc (cest=utc+2hrs).
the expected output file:
2015-05-13 21:12:11 2015-05-13 22:13:23 2015-05-14 05:12:13 2015-05-14 06:34:45 2015_05-14 17:39:44
i used date
command many options (-d
, -u
) no effect. i'd grateful suggestions.
i can generate example via options you've tried:
$ date +"%f %t" -d "2015-05-13 23:12:11 cest" -u 2015-05-13 21:12:11
stick in loop , you'll able operate on whole file.
Comments
Post a Comment