Get a date and time right now

From SQLZoo
Jump to navigation Jump to search

Get the current date and/or time

schema:gisq

SQL Standard specifies CURRENT_TIMESTAMP, CURRENT_DATE and CURRENT_TIME. These are widely ignored :(

SELECT Now(), Date(), Time()
 FROM nix
SELECT GETDATE()
 FROM nix
SELECT SYSDATE, SYSTIMESTAMP 
 FROM gisq.nix
SELECT CURRENT_TIMESTAMP, CURRENT_DATE, CURRENT_TIME
 FROM nix
DataWars, Data Science Practice Projects - LogoDataWars: Practice Data Science/Analysis with +100 Real Life Projects
Your server today is: digitalocean-sqlzoo