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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -