Home > Database > Mysql Tutorial > body text

Which punctuation mark can be used as a separator between time parts in MySQL?

WBOY
Release: 2023-09-06 14:29:08
forward
804 people have browsed it

哪个标点符号可以用作 MySQL 时间部分之间的分隔符?

与日期值的情况一样,MySQL 也允许我们使用宽松的时间格式。我们可以在时间部分之间使用任何标点符号作为分隔符。一些示例如下 -

mysql> Select timestamp('2017-10-20 04+05+36');
+----------------------------------+
| timestamp('2017-10-20 04+05+36') |
+----------------------------------+
| 2017-10-20 04:05:36              |
+----------------------------------+
1 row in set (0.00 sec)


mysql> Select timestamp('2017-10-20 04*05*36');
+----------------------------------+
| timestamp('2017-10-20 04*05*36') |
+----------------------------------+
| 2017-10-20 04:05:36              |
+----------------------------------+
1 row in set (0.00 sec)


mysql> Select timestamp('2017-10&20 04@05+36');
+----------------------------------+
| timestamp('2017-10&20 04@05+36') |
+----------------------------------+
| 2017-10-20 04:05:36              |
+----------------------------------+
1 row in set (0.00 sec)


mysql> Select timestamp('2017*10@20 04*05*36');
+----------------------------------+
| timestamp('2017*10@20 04*05*36') |
+----------------------------------+
| 2017-10-20 04:05:36              |
+----------------------------------+
1 row in set (0.00 sec)
Copy after login

The above is the detailed content of Which punctuation mark can be used as a separator between time parts in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template