How to remove Fractional value from timestamp MySQL -


fractional value timestamp mysql

table:

create table `note` (   `id` binary(16) not null',   `note` text,   `updated` timestamp(6) not null default current_timestamp(6) ',   primary key (`id`) ) ; 

query:

select unix_timestamp(updated) id = 1; 

result: 1491556345.0002231 somthing

but want 1491556345 , how remove fractional value.

thanks

you can use truncate this:

select truncate(unix_timestamp(updated),0) id = 1; 

Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -