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

'hasOwnProperty' in javascript -

c# - Update a combobox from a presenter (MVP) -

android - Unable to generate FCM token from dynamically instantiated Firebase -