title: Nodejs Handlebars How to run serverside javascript
body: <p>I am trying to use Handlebars on Nodejs.</p>
  
  <p>I can execute plain vars but what if I want to execute javascript code to output some values? 
  In PHP we would do this :</p>
  
  <pre><code>&lt;div&gt;This is formatted date : &amp;lt;?php echo date($oldDate); ?&amp;gt; &lt;/div&gt;
  </code></pre>
  
  <p>Example in nodejs handlebars: </p>
  
  <pre><code>&lt;div&gt;This is non formatted date: {{olddate}}&lt;/div&gt;
  &lt;div&gt;This is formatted date : {{ date(olddate)}}&lt;/div&gt;
  </code></pre>
  
  <p>I know that in EJS template engine we can do this by putting inside &lt;% like this </p>
  
  <pre><code>&lt;div&gt;This is formatted date : &lt;% date(olddate)%&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Thank you for your answers</p>