github.com/matrixorigin/matrixone@v0.7.0/test/distributed/cases/function/func_datetime_utc_timestamp.result (about) 1 select unix_timestamp(utc_timestamp()); 2 unix_timestamp(utc_timestamp()) 3 1655148590 4 create table t1 (ts timestamp); 5 set time_zone='+00:00'; 6 select unix_timestamp(utc_timestamp())-unix_timestamp(utc_timestamp()); 7 unix_timestamp(utc_timestamp())-unix_timestamp(utc_timestamp()) 8 0 9 insert into t1 (ts) values ('2003-03-30 02:30:00'); 10 set time_zone='+10:30'; 11 select unix_timestamp(utc_timestamp())-unix_timestamp(utc_timestamp()); 12 unix_timestamp(utc_timestamp())-unix_timestamp(utc_timestamp()) 13 0 14 insert into t1 (ts) values ('2003-03-30 02:30:00'); 15 set time_zone='-10:00'; 16 insert into t1 (ts) values ('2003-03-30 02:30:00'); 17 select * from t1; 18 ts 19 2003-03-29 16:30:00 20 2003-03-29 06:00:00 21 2003-03-30 02:30:00 22 drop table t1; 23 select utc_timestamp()-utc_timestamp(),weekday(utc_timestamp())-weekday(utc_timestamp()),unix_timestamp()-unix_timestamp(utc_timestamp()); 24 utc_timestamp()-utc_timestamp() weekday(utc_timestamp())-weekday(utc_timestamp()) unix_timestamp()-unix_timestamp(utc_timestamp()) 25 0 0 28800 26 CREATE TABLE t1 (a TIMESTAMP); 27 INSERT INTO t1 select (utc_timestamp()); 28 INSERT INTO t1 select (utc_timestamp()); 29 SELECT 1 FROM t1 ORDER BY 1; 30 1 31 1 32 1 33 DROP TABLE t1; 34 DROP TABLE if exists t1; 35 create table t1 (a int primary key, b int, c int, d timestamp); 36 insert into t1 select 1,1,1,utc_timestamp(); 37 insert into t1 select 2,0,0,null; 38 select a,b,c,year(d) from t1; 39 a b c year(d) 40 1 1 1 2022 41 2 0 0 null 42 DROP TABLE t1; 43 CREATE TABLE t1 (a TIMESTAMP); 44 INSERT INTO t1 select (utc_timestamp()); 45 INSERT INTO t1 select (utc_timestamp()); 46 INSERT INTO t1 select (utc_timestamp()); 47 SELECT year(a) FROM t1 WHERE a > '2008-01-01'; 48 year(a) 49 2022 50 2022 51 2022 52 DROP TABLE t1;