• Ivy Seo

Combine Date and Time into Timestamp


Combine date + time column => timestamp_ column :

date = column : 'yyyy-mm-dd'

time = column : 'hh-mm-ss'

timestamp_ = column name which type is Timestamp.

Its value will be Date + Time: 'yyyy-mm-dd hh-mm-ss'


Postgresql Query from C# :

cmd.CommandText = 
"UPDATE Table_Name SET timestamp_ = (Table_Name.date + Table_Name.time)::timestamp";


Another example (to understand how this works) :


** to use Timestamp: need Timescaledb

> CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;