
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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)
- Related Articles
- How to insert current date/ time using now() in a field with MySQL?
- Java Program to Convert the local Time to GMT
- MySQL select * and find record with current date
- GMT Time in Perl
- Get the time difference and convert it to hours in MySQL?
- Set a MySQL field with the current date (UNIX_TIMESTAMP(now))
- MySQL query to select records with a particular date and time?
- Select records from MySQL NOW() -1 Day?
- Calling NOW() function to fetch current date records in MySQL?
- Select rows from a table with date between 90 days ago and now in MySQL
- Select a field and if it's null, select another with MySQL?
- Set current date and time to timestamp in MySQL
- Convert MySQL null to 0?
- Convert the Current Time to a java.sql.Date Object
- How to select a date less than the current date with MySQL?

Advertisements