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  -u20150903161322Or, without the -u the local time (here, BST):$ date +%Y%m%d%H%M%S20150903171322Now if I add an argument to date, I get an error:echo 20150903154607 | xargs date +%Y%m%d%H%M%S -udate: extra operand `20150903154607'Is there any way I can do perform this conversion without such errors?
How can I convert a local date-time into UTC date-time?
date