
- 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
How to apply NOW() to timestamps field in MySQL Workbench?
Let us first create a table −
create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ShippingDate timestamp );
Insert some records in the table using insert command. Here, we have included the current date with NOW() −
INSERT INTO DemoTable(ShippingDate) VALUES(now());
Display all records from the table using select statement −
SELECT *FROM DemoTable;
Output
Following is the screenshot of query in MySQL workbench to set NOW() to timestamp field “ShippingDate”. The query also displays the output below −
- Related Articles
- How to compare timestamps in MySQL?
- How to take MySQL database backup using MySQL Workbench?
- How to insert current date/ time using now() in a field with MySQL?
- How to keep the connection alive in MySQL Workbench?
- How can we apply UNIQUE constraint to the field of an existing MySQL table?
- How to convert char field to datetime field in MySQL?
- Declare syntax error in MySQL Workbench?
- Performance Report Controls in Mysql Workbench
- How to apply a condition only if field exists in MongoDB?
- How to apply CROSS JOIN correctly in MySQL?
- How to get ER model of database from server with MySQL Workbench?
- How can we apply the PRIMARY KEY constraint to the field of an existing MySQL table?
- Set a MySQL field with the current date (UNIX_TIMESTAMP(now))
- What is the difference between UNIX TIMESTAMPS and MySQL TIMESTAMPS?
- What is MySQL UNIQUE constraint and how can we apply it to the field of a table?

Advertisements