I have date and time extracted from JSON in following format
I need to convert it to local time of Pakistan and add 5 hours to that time so the result is like:
How I can achieve this?
I am trying to get a bash script working and in order to do so I need to transform a local time in +%Y%m%d%H%M%S format (example: "20150903170731") into UTC time in the same format.
I know date -u can give me the current UTC time:
$ date +%Y%m%d%H%M%S -u
Or, without the -u the local time (here, BST):
$ date +%Y%m%d%H%M%S
Now if I add an argument to date, I g
date -u gives date and time in GMT format
date gives date and time in local timezone
date +%s gives local time in epoch time
Is there a way to get GMT time in epoch format?
In the AIX I'm using, there are only -n and -u options available (so I'm unable to use -f option).
My aim is to calculate Offset in hours between localtime and GMT.