If this isn't a bug, maybe you could consider it a feature request:
gnuplot> TIMEFMT = '%Y-%m-%d'
gnuplot> set timefmt TIMEFMT
time format string expected
One hacky workaround is:
eval('set timefmt "%s"',TIMEFMT)
but I hope we can agree that isn't ideal. Another thing which doesn't work is setting the xrange with a string function.
set xrange ["2012-01-13":] #works OK
set xrange [strftime(TIMEFMT,strptime(TIMEFMT,"2012-01-13")) : ] #produces funny results.
Again, we can work around this with `eval`, but it seems less than ideal.
For a full script which you can play around with and use case, see the following:
fun info: OSX 10.5.8, gnuplot 4.4 and gnuplot 4.6 (I'll test with 4.6 and 4.7 when I'm able).