The quotes work in pairs and when an initial double quote is used, it only applies until the next occurance of the double quote so in line 5 you have "text", then "date", then "45", then "<? echo (date (", then ")); ?>"
so this causes the Y-m-d to not appear in quotes.
i would try to use the single quotes in the following manner '<? echo(date("Y-m-d"));?>'
i had a similar problem about a month ago and backed completely away from it and used this
then i just move Today around. but what you are doing is more elegant.