Posts

Showing posts with the label Date Functions

Know Your MYSQL: Date functions

Image
List of mySQL Date function: NOW()   : It will give you the current date and time. For example: MYSQL> select  NOW() ; Output: 2017-02-25 00:52:57; CURDATE()  : It will give you current date. For example : MYSQL> select  CURDATE() ; Output:  2017-02-25; UNIX_TIMESTAMP()  : It will give you the current date and time in epoch format For example: MYSQL> select  UNIX_TIMESTAMP() ; Output:  1487964177 MYSQL> select  UNIX_TIMESTAMP (‘2017-02-25 00:52:57’); Output: 1487964177 FROM_UNIXTIME () : It will give you DATE and TIME from the epoch time format. For example: MYSQL> SELECT  FROM_UNIXTIME (1447430881); Output:  ‘2015-11-13 10:08:01’ MYSQL> SELECT  FROM_UNIXTIME (1447430881) + 0; Output: 20151113100801 DATE_FORMAT () : It will let you decide in what format you want to show date. For example : MYSQL> select DATE_FORMAT(NOW(),’%m-%d-%Y’) Output: 11-04-201...

Popular posts from this blog

How to Secure Session Management in Node

How to download a file using command prompt (cmd) Windows?

Angular 9 - User Registration and Login Example & Tutorial