select extract(epoch from now());
select extract('epoch' from time_stop at time zone 'Europe/Warsaw')
as time_stop_timestamp from tabela
13 lut 2015
select extract(epoch from now());
select extract('epoch' from time_stop at time zone 'Europe/Warsaw')
as time_stop_timestamp from tabela
dodano:
!{$data[ii].timestamp_modif|date_format:"%Y-%m-%d %H:%M:%S"}!<br/>
select czas, date_trunc('day', czas)+'15:59:12' as czas2 from czas limit 1;
UPDATE czas set czas = date_trunc('day', czas)+'15:59:12' WHERE wt_id = 3850;
"2008-11-07 15:58:37";"2008-11-07 15:59:12"
select
czas, date_trunc('day', czas), date_trunc('day', timestamp '2010-08-11')
from
czas_t
where
date_trunc('day', czas) = date_trunc('day', timestamp '2010-08-11')
"2010-08-11 07:37:46";"2010-08-11 00:00:00";"2010-08-11 00:00:00"
"2010-08-11 07:40:49";"2010-08-11 00:00:00";"2010-08-11 00:00:00"
"2010-08-11 08:04:42";"2010-08-11 00:00:00";"2010-08-11 00:00:00"
"2010-08-11 09:12:32";"2010-08-11 00:00:00";"2010-08-11 00:00:00"
"2010-08-11 08:55:52";"2010-08-11 00:00:00";"2010-08-11 00:00:00"
"2010-08-11 15:59:12";"2010-08-11 00:00:00";"2010-08-11 00:00:00"
ALTER TABLE 'pozycje'
ADD
'modif' TIMESTAMP DEFAULT 'curent_timestamp' NOT NULL
php:
$date = date("Y-m-d H:i:s",strtotime($line[modif]));
echo $date;
sql:
select date_trunc('second', now()::timestamp without time zone)