I have a string in format 20141225093000 which represents Dec 25, 2014 09:30:00 and I want to convert the original format to a unix timestamp format so i can do time operations on it.How would I do this in bash?
I can easily parse out the values with expr but I was hoping to be able to identify a format like YYYYmmddHHMMSS and then convert it based on that.
datecommand. Are you targeting only platforms with GNU date, or do you need to support other, incompatible versions ofdate(such as MacOS's BSD-derived implementation)?