1. --1. 获取当前日期和时间(年月日时分秒)
    2. --写法一:
    3. select from_unixtime(unix_timestamp(),"yyyy-MM-dd HH:mm:ss")
    4. 2020-04-21 11:02:55
    5. --写法二:
    6. select substr(current_timestamp(),1,19)
    7. 2020-04-21 11:02:55
    8. -- 2.获取当前日期
    9. --写法一:
    10. select from_unixtime(unix_timestamp(),"yyyy-MM-dd")
    11. 2020-04-21
    12. --写法二:(推荐)
    13. select current_date()或者select current_date
    14. 2020-04-21
    15. -- 写法三:
    16. select substr(current_timestamp(),1,10)
    17. 2020-04-21