NonplayerCharacter

PGexercises.com | Seconds between dates

Mar 22nd, 2022 (edited)
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- https://pgexercises.com/questions/date/interval2.html
  2.  
  3. select date_part('epoch', '2012-09-02 00:00:00'::timestamp - '2012-08-31 01:00:00'::timestamp)
  4. -- returns 169200, which is accepted as correct
  5.  
  6. select count(*) from generate_series
  7.         ('2012-08-31 01:00:00'::timestamp,
  8.          '2012-09-02 00:00:00'::timestamp,
  9.          '1 second'::interval) as gs
  10. -- returns 169201, which is not accepted
Add Comment
Please, Sign In to add comment