oracle current date without time
SELECT trunc(sysdate) FROM dual; -- returns a DATE 01/12/2021 00:00:00
SELECT to_char(sysdate, 'DD/MM/YYYY') FROM dual; -- returns a string '01/12/2021'
oracle current date without time
SELECT trunc(sysdate) FROM dual; -- returns a DATE 01/12/2021 00:00:00
SELECT to_char(sysdate, 'DD/MM/YYYY') FROM dual; -- returns a string '01/12/2021'
oracle add time to date
SELECT sysdate + 1 FROM dual; -- Tomorrow 12/01/2021 14:27:27
SELECT trunc(sysdate) + 1 FROM dual; -- Tomorrow 12/01/2021 00:00:00
SELECT sysdate + 1 / 24 FROM dual; -- 1 hour ahead
SELECT sysdate + 1 / 24 / 60 FROM dual; -- 1 minute ahead
SELECT add_months(trunc(sysdate), 1) FROM dual; -- 1 month ahead (no time)
SELECT trunc(sysdate) + 30 FROM dual; -- 30 days ahead (no time)
SELECT add_months(trunc(sysdate), +12*2) FROM dual; -- 2 years ahead (no time)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us