title: how use custom joomla date in mysql query
body: <p>i have this query from a custom class in Joomla which uses CURDATE and NOW. </p>
  
  <pre><code>$query = "SELECT DISTINCT catid FROM table_x WHERE DATE(publish_up)=CURDATE() AND publish_up&lt;=NOW()";
  </code></pre>
  
  <p>default server time had to change so i want to change it to use joomla custom time called from here:</p>
  
  <pre><code>$date = JFactory::getDate('now', new DateTimeZone('Europe/Berlin'));
  </code></pre>
  
  <p>i hoped it whould be easy (since i am kinda nooby) like </p>
  
  <pre><code>....WHERE DATE(publish_up)='".$date."' AND ....
  </code></pre>
  
  <p>but it doesn't work
  any ideas?</p>