Skip to content

Instantly share code, notes, and snippets.

@AgungPambudi
Last active July 9, 2021 02:06
Show Gist options
  • Save AgungPambudi/5424bf1c8f854ba9b547b534806dbd9b to your computer and use it in GitHub Desktop.
Save AgungPambudi/5424bf1c8f854ba9b547b534806dbd9b to your computer and use it in GitHub Desktop.
#author : Agung Pambudi
#email : mail@agungpambudi.com
#version : 0.1
#==============================================================================
# _ _ _
# ___ ___ _ _ ___ ___ ___ ___ _____| |_ _ _ _| |_| ___ ___ _____
#| .'| . | | | | . | . | .'| | . | | | . | |_| _| . | |
#|__,|_ |___|_|_|_ | _|__,|_|_|_|___|___|___|_|_|___|___|_|_|_|
# |___| |___|_|
SELECT CAST(DATE_FORMAT(DATE(TANGGAL),'%Y-%m-%d') as date) FROM tablename;
SELECT DATE_FORMAT(STR_TO_DATE(TANGGAL, '%d-%m-%Y'), '%Y-%m-%d') AS TANGGAL FROM tablename;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment