TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

MySQL Date and Time

MySQL Date and Time for beginners and professionals on mysql tutorial, examples, functions, programming, mysql, literals, cursor, procedure, trigger, regexp_like(), regexp_replace operator, regular expression, regexp_instr(), crud etc.

<< Back to MYSQL

Literals: Date and Time

In MySQL programming, Date and Time literals are in the form of strings or numbers.

Following are some more formats in which date and time can be displayed.

EXAMPLE FORMAT
'2018-10-18' 'YYYY-MM-DD'
'20181018' 'YYYYMMDD'
20181018 YYYYMMDD
'18-10-18' 'YY-MM-DD'
181018 YYMMDD
'2018-10-18 5:25:20' 'YYYY-MM-DD HH:MM:SS'
'2018101852520' 'YYYYMMDDHHMMSS'
2018101852520 YYYYMMDDHHMMSS
'18-10-18 5:25:20' 'YY-MM-DD HH:MM:SS'
'18101852520' 'YYMMDDHHMMSS'
18101852520 YYMMDDHHMMSS

Example 1

select id, name, salary, date_format(sal_date,'%d-%m-%y') as new_date_formate from staff1;
MySQL Date and Time

Example 2

select id, name, salary, date_format(sal_date,'%d%m%y') as new_date_formate from staff1;
MySQL Date and Time
Next TopicMySQL Procedure




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf