title: Oracle : how to subtract two dates and get minutes of the result
body: <p>I wrote this function to get minutes from a date, but I cannot get minutes between two dates, How to get that ? </p>
  
  <pre><code>FUNCTION get_minute(p_date DATE)
  RETURN NUMBER
  IS
  BEGIN
      IF p_date IS NOT NULL THEN
          return  EXTRACT(MINUTE FROM TO_TIMESTAMP(to_char(p_date,'DD-MON-YYYY HH:MI:SS'),'DD-MON-YYYY HH24:MI:SS'));
      ELSE
          RETURN 0;
      END IF;
  END get_minute;
  </code></pre>