tljk
:/opt
/IBM
/db2
/V9.
1/bin
>db2 values current
date1 ----------01/21/2013 1 record(s) selected.
tljk
:/opt
/IBM
/db2
/V9.
1/bin
>db2 values current time
1 --------12:53:16 1 record(s) selected.
tljk
:/opt
/IBM
/db2
/V9.
1/bin
>db2 values current timestamp
1 --------------------------2013-01-21-12.
53.
21.
466015 1 record(s) selected.
tljk
:/opt
/IBM
/db2
/V9.
1/bin
>db2 values current timezone
1 -------- 80000.
1 record(s) selected.
tljk
:/opt
/IBM
/db2
/V9.
1/bin
>db2
"values year(current timestamp)"1 ----------- 2013 1 record(s) selected.
tljk:/opt/IBM/db2/V9.1/bin >db2 "values char(year(current timestamp))||char(month(current timestamp))||char(day(current timestamp>
1
---------------------------------
2013 1 21
1 record(s) selected.
tljk:/opt/IBM/db2/V9.1/bin >db2 "values dayofweek(current timestamp)"
1
-----------
2
1 record(s) selected.
tljk:/opt/IBM/db2/V9.1/bin >db2 "values dayofyear(current timestamp)"
1
-----------
21
1 record(s) selected.
如果和标准的时区进行减法操作,得到的是GMT标准时区时间:
tljk:/opt/IBM/db2/V9.1/bin >db2 values current timestamp - current timezone
1
--------------------------
2013-01-21-04.57.43.821818
1 record(s) selected.
添加新评论0 条评论