9
9
# Set timezone to GMT-3, to make it possible to use "interval 3 hour"
10
create table t1 (Tag int not null, Monat int not null,
11
Jahr int not null, index(Tag), index(Monat), index(Jahr) );
12
insert into t1 values (16,9,1998),(16,9,1998);
13
SELECT CONCAT(Jahr,'-',Monat,'-',Tag) AS Date,
14
UNIX_TIMESTAMP(CONCAT(Jahr,'-',Monat,'-',Tag)) AS Unix
10
set time_zone="+03:00";
12
create table t1 (Zeit time, Tag tinyint not null, Monat tinyint not null,
13
Jahr smallint not null, index(Tag), index(Monat), index(Jahr) );
14
insert into t1 values ("09:26:00",16,9,1998),("09:26:00",16,9,1998);
15
SELECT CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit) AS Date,
16
UNIX_TIMESTAMP(CONCAT(Jahr,'-',Monat,'-',Tag,' ',Zeit)) AS Unix
22
# Restore timezone to default
23
set time_zone= @@global.time_zone;