Convert date time into specified format in PostgreSQL query
<p>For converting datetime into SQL Server CE, I am using below format</p>

<pre><code>var date = "CONVERT(datetime,'" + 
((DateTime) DateTime.UtcNow).ToString("yyyyMMdd HH:mm:ss tt", new CultureInfo("en-us")) 
+ "',112)";
</code></pre>

<p>For Oracle:</p>

<pre><code>var date = "TO_DATE('" 
+ ((DateTime)DateTime.UtcNow).ToString("MMddyyyy hh:mm:ss tt") 
+ "', 'mmddyyyy hh:mi:ss')";
</code></pre>

<p>And for MySQL:</p>

<pre><code>var date = "STR_TO_DATE('" 
+ ((DateTime)DateTime.UtcNow).ToString("yyyyMMdd HH:mm:ss", new CultureInfo("en-us")) 
+ "','%Y%m%d %H:%i:%s')";
</code></pre>

<p>Can anyone tell me how to convert the same in <strong>PostgreSQL</strong>?</p>

<p><strong>Note:</strong> I am using <code>timestamp</code> datatype</p>