PostgreSQL time difference (hours)

tags: PostgreSQL  

PostgreSQL time difference (hours)

SQL is as follows:

SELECT er.create_time,er.update_date,round(cast(date_part('epoch', er.update_date - er.create_time)/60/60 as numeric ),1) as timecha
FROM event_release AS er
WHERE er.create_time >= '2021-3-10 00:00:00'
AND er.create_time <= '2021-3-11 23:59:00'
ORDER BY er.create_time

The results of the operation are shown below:
 ( )

Intelligent Recommendation

CentOS time difference 8 hours

View the system time command: Date View hardware time command: hwclock Here you can see that the time is 8 hours, and the clock synchronization is required; 1. Install the NTPDATE tool 2, modify the t...

C # calculates the time difference, difference in hours, minutes difference, second difference

https://msdn.microsoft.com/en-us/library/system.timespan(v=vs.110).aspx TotalSeconds TotalMinutes TotalDays...

postgresql find two time difference

method 1: The date_part() function is used to return a single part of the date/time, such as year, month, day, hour, minute, etc. Method 2: Method 3 The DATE_TRUNC function truncates the timestamp exp...

PostgreSQL time zone field difference

Why can't 80% of the code farmers can't do architects? >>>   PostgreSQL Time Field Type There is Time, TimeStamp, Date, and Interval, where Time and TimeStamp have the difference in...

Js calculates the time difference result, such as 1.5 hours &nbsp;3 hours

JavaScript calculates the time difference result, such as 1.5 hours, 3 hours  ...

More Recommendation

Java calculates time difference, a few hours a few hours

From the front time to select the control, the String type is used:...

IOS-time format conversion problem (12 hours and 24 hours difference)

IOS time format difference Problem: When using NSDateFormatter to convert, the format string uses "HH" in the format string, and the NSString object of the hour greater than 12 in the IOS de...

Springboot time difference of 8 hours processing

Run environment new test class (TestDate.java) Operating environment execution The time zone acquired by the java virtual machine is not the Chinese time zone. It should be increased by 8 hours. The a...

Beego orm time difference of eight hours

When using beego's orm, after the mysql database is inserted into the datetime format field, the database will see 8 hours ahead of normal time. solve Add loc=Local when connecting to the database....

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top