Practical 19 - MySQL - Date Time Functions
Practical 19 - MySQL - Date Time Functions
Practical 19 - MySQL - Date Time Functions
+---------------------+
| now() |
+---------------------+
| 2021-01-27 11:55:16 |
+---------------------+
+------------+
| curdate() |
+------------+
| 2021-01-27 |
+------------+
+-----------------------------+
| date('2021-01-27 11:54:56') |
+-----------------------------+
| 2021-01-27 |
+-----------------------------+
+---------------------+
| month('2021-07-02') |
+---------------------+
| 7 |
+---------------------+
+-------------------+
| day('2021-07-02') |
+-------------------+
| 2 |
+-------------------+
+-----------------------+
| weekday('2021-07-02') |
+-----------------------+
| 4 |
+-----------------------+
+-----------------------+
| weekday('2021-01-27') |
+-----------------------+
| 2 |
+-----------------------+
+-----------------------+
| dayname('2021-01-27') |
+-----------------------+
| Wednesday |
+-----------------------+
+-----------------------+
| dayname('2021-02-27') |
+-----------------------+
| Saturday |
+-----------------------+
+-------------------------+
| dayofyear('2021-02-27') |
+-------------------------+
| 58 |
+-------------------------+