datetime - Timestamp with a millisecond precision: How to save them in MySQL -
I have to develop an application using MySQL and I have to save values like "1412792828893" which represent a timestamp But this is the exact millisecond, after 1.1.1970, declare the quantity of milliseconds as the line How should the announcement be made to be able to save timestamp values with this precision? You declare columns with partial-time datatype in MySQL version 5.6.4 or later is required. Not sure if you have the right version? Try Read it: If you have several milliseconds, try to get it DATETIME (3) value , for example, is shown in milliseconds. (Note that MySQL internal partial arithmetic, such as If you are using an earlier version of MySQL and you need the accuracy of the sub-time, your best way is to upgrade. If for some reason you can not upgrade, you might consider using the timestamp but unfortunately it does not work. All values are set to
0000-00-00 00:00:00
if not, then 'probability' (`id` int (11) Not zero is AUTO_INCREMENT, `Segment_id` et (11) not a null;` probability 'is not float,' measured_a 'timestamp nose, `provider_id' ent (11) null, primary key (` id`));
SELECT NOW (3) . If you get an error, you do not have the correct version. For example,
DATETIME (3) will give you millisecond resolution in your timestamp, and
TIMESTAMP (6) will give you a Microsoft resolution * on the niks-style timestamp.
Now (3) will give you the current time with the millisecond precision from the operating system of your MySQL server.
FROM_UNIXTIME (ms * 0.001)
* 0.001 , is always handled as a IEEE754 double precision floating point, therefore it is unlikely that you can see that the sun is white The dwarf star will lose accuracy before becoming a star.)
BIGINT or
DOUBLE column. To store JavaScript timestamps such as those numbers are
FROM_UNIXTIME (col * 0.001) still work fine if you need the current time to store in such a column You can use
UNIX_TIMESTAMP () * 1000
Comments
Post a Comment