So here's the situation I am trying to convert Dates and Times so I can use them in a Java Script within my Smarty Template File.
Here is the Snipet from my Template File:
<div class="containertable">
{foreach item=e from=$ads} {if $e.value}{if $e.field==e_10}
{if $e.value == 'November'}
{php}$date = "11";{/php}
{php}echo "$date";{/php}
{php}$newdate = "dateFuture = new Date(2007,$date,13,17,25,00);";{/php}
{literal} <script type="text/javascript">
<!-- //start
// format: dateFuture = new Date(year,month-1,day,hour,min,sec)\n'+
// example: dateFuture = new Date(2003,03,26,14,15,00) = April 26, 2003 - 2:15:00 pm\n\n'+
//Set Date Here
dateFuture = new Date(2007,11,13,17,25,00);
{$e.field==e_10} contains the Month Variable. I want the Dates to appear as numbers, so I used the If Statement and used November for testing purposes. So right now the number 11 does appear on the Page which is good. Except I need it to be a Part of the Java Script.
I replace the following from the Javascript:
dateFuture = new Date(2007,11,13,17,25,00);
With:
<? echo "$newdate"; ?>
That didn't work.
Any suggestions?? Or advise on a better way to go about this?