- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
What MySQL will return on adding microseconds in the timestamp value for converting it into an integer?
As we know that the value of timestamp can be converted to a number of seconds with the help of UNIX_TIMESTAMP() function. MySQL would ignore the microseconds added to the value of timestamp because the value of UNIX_TIMESTAMP is only 10digits long.
Example
mysql> SELECT UNIX_TIMESTAMP('2017-10-22 04:05:36')AS 'Total Number of Seconds'; +-------------------------+ | Total Number of Seconds | +-------------------------+ | 1508625336 | +-------------------------+ 1 row in set (0.00 sec) mysql> SELECT UNIX_TIMESTAMP('2017-10-22 04:05:36.200000')AS 'Total Number of Seconds'; +-------------------------+ | Total Number of Seconds | +-------------------------+ | 1508625336 | +-------------------------+ 1 row in set (0.00 sec)
The queries above shows that the output remains same even after adding the 6 digits value of microseconds.
- Related Articles
- On passing an out-of-range value in UNIX_TIMESTAMP() or FROM_UNIXTIME() function, what MySQL will return?
- Python Pandas - Return the microseconds from Timedelta object using integer input
- What will be the result when adding a positive integer to a negative integer?
- Searching for an integer value in a varchar field in MySQL?
- What will MySQL CHAR_LENGTH() function return if I provide NULL to it?
- Adding binary without converting in JavaScript
- Reorder integer except for value 0 with MySQL?
- Python Pandas - Return the microseconds from Timedelta object
- Convert DATE timestamp to return only the month name in MySQL
- Adding an element into the Hashtable in C#
- How to convert from Unix timestamp to MySQL timestamp value?
- Adding the specified key and value into HybridDictionary in C#
- Select data and set value to boolean based on timestamp column in MySQL
- Return the nearest greater integer of the decimal number it is being called on in JavaScript
- Convert UNIX timestamp into human readable format in MySQL?

Advertisements