• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to update hours in timestamp without effecting date in postgreSql?

Resolved: How to update hours in timestamp without effecting date in postgreSql?

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have two columns in_time and out_time, both are timestamps with timezone. When I try to update/change hours, date also effected, I only want to change hours without effecting date(Database:Postgresql)
Inputs
Output I am getting
Expected Output

Answer:

You have to CAST twice, first a DATE and second a TIME. Do the calculation on the TIME and add the TIME to the DATE to create a new TIMESTAMP:

If you have better answer, please add a comment about this, thank you!

postgresql sql
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to separate multiple answers in one column, for multiple columns, by creating extra columns

26/03/2023

Resolved: How to set consistent decimal separators in R data frame?

26/03/2023

Resolved: How to resolve LNK2001 in c++ projects

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.