Check out example codes for "mariadb hours between two dates". It will help you in understanding the concepts better.

Code Example 1

SELECT 
    order_logs.order_logs_created,
    TIMESTAMPDIFF(HOUR,
        order_logs.order_logs_created,
        NOW())
FROM
    order_logs

Learn ReactJs, React Native from akashmittal.com