Mysql Time Epoch subtract 4 hours

1

How do you spend 4 hours in a field that is in Time Epoch 1475638722 ?

format

I tried with DATE_SUB(field,INTERVAL 4 HOUR) but I did not get it.

    
asked by skycomputer2 05.10.2016 в 05:46
source

1 answer

1

You could use from-unixtime to then apply the DATE_SUB()

SELECT DATE_SUB(FROM_UNIXTIME(field),INTERVAL 4 HOUR )  from  nameTable;

demo

Response to Comment

SELECT UNIX_TIMESTAMP(DATE_SUB(FROM_UNIXTIME(field),INTERVAL 4 HOUR ))  from mytable
    
answered by 05.10.2016 в 06:26