While researching a different approach to convert a timestamp like   2015-09-08 11:07:35 to1441703255I found a lot of pretty commonly found solutions use e.g.date +%s --date 2015-09-08 11:07:35awk, perl or similiar solutions.However SE conversion answer seems to use printf for that conversion on a newer bash version.As this is to be used in a script with some limitations I rather not have to rely on date for that, but instead try an approach which might be faster.My relevant tries so far:printf '%(%s)2015-09-08 11:07:35'bash: printf: warning: `2': invalid time format specificationprintf '%(%s)T' 2015-09-08 11:07:35bash: printf: 2015-09-08 11:07:35: invalid numberIt seems I am unable to correctly use printf as I lack the exact manual where the dateformat string is described. The manpage and  info coreutils 'printf invocation' did not help me solve this issue.bash version isbash --versionGNU bash, Version 4.3.11(1)-release (x86_64-pc-linux-gnu)
convert timestamp to epoch with bash builtin printf
bash;date;printf
The other question specifically asks how to get current time in seconds since the Epoch. The date format and arguments are described in the bash manual (scroll down to printf):%(datefmt)TCauses printf to output the date-time string resulting from using datefmt as a format string for strftime(3). The corresponding argument  is an integer representing the number of seconds since the epoch. Two  special argument values may be used: -1 represents the current time,  and -2 represents the time the shell was invoked. If no argument is  specified, conversion behaves as if -1 had been given. This is an  exception to the usual printf behavior.So the argument has to be an integer number of seconds since epoch (e.g. see the answer to How do I convert an epoch timestamp to a human readable format). Unless you use the special values (-1 or -2) or no argument (and in that case it defaults to -1)