- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Select current time with MySQL now() and convert it to GMT 0?
You can use utc_timestamp() for this. Following is the syntax −
SELECT utc_timestamp();
Let us check the current time using now().
Following is the query −
mysql> select now();
This will produce the following output −
+---------------------+ | now() | +---------------------+ | 2019-04-11 17:50:05 | +---------------------+ 1 row in set (0.00 sec)
Following is the query to get GMT 0 −
mysql> SELECT utc_timestamp();
This will produce the following output −
+---------------------+ | utc_timestamp() | +---------------------+ | 2019-04-11 12:20:08 | +---------------------+ 1 row in set (0.00 sec)
Advertisements