I have a date like 2014-01-30 05:04:27 GMT
, and if I run date -d "2014-01-30 05:04:27 GMT"
, the output is in my server's timezone (Thu Jan 30 16:04:27 EST 2014
).
With the use of grep and cut, I have extracted the date in GMT from a file. However, I am struggling to then convert this into my local time.
For example:
grep "something" logfile.txt | grep "Succeeded" | cut -f1 -d'['
Output: 2014-01-30 05:04:27 GMT
What can I add on the end, to pass that output to date -d
?
Attempted:
grep "something" logfile.txt | grep "Succeeded" | cut -f1 -d'[' | date -d
grep "something" logfile.txt | grep "Succeeded" | cut -f1 -d'[' | date
grep "something" logfile.txt | grep "Succeeded" | cut -f1 -d'[' | date -d "$1"