pb9.0如何获取系统时间?
要实时跟踪显示的那种
在窗口Open事件中写
st_1.text = STring(today(),'yyyy-mm-dd') + " " + String(now(),'hh:mm:ss')
timer(1)
在窗口的timer事件中写
st_1.text = string(today(),'yyyy-mm-dd')+ " " + string(now(),'hh:mm:ss')
运行OK!
//加星期的
st_1.text = STring(today(),'yyyy-mm-dd') + " " + String(now(),'hh:mm:ss')+" " + ge_week()
timer(1)
//定义获取星期的函数 函数名称ge_week()
int liWeek;
string ls_week
liWeek = DayNumber(today())
choose case liWeek
case 1
ls_week = "星期天"
case 2
ls_week = "星期一"
case 3
ls_week = "星期二"
case 4
ls_week = "星期三"
case 5
ls_week = "星期四"
case 6
ls_week = "星期五"
case 7
ls_week = "星期六"
end choose
return ls_week
要实时跟踪显示的那种
在窗口Open事件中写
st_1.text = STring(today(),'yyyy-mm-dd') + " " + String(now(),'hh:mm:ss')
timer(1)
在窗口的timer事件中写
st_1.text = string(today(),'yyyy-mm-dd')+ " " + string(now(),'hh:mm:ss')
运行OK!
//加星期的
st_1.text = STring(today(),'yyyy-mm-dd') + " " + String(now(),'hh:mm:ss')+" " + ge_week()
timer(1)
//定义获取星期的函数 函数名称ge_week()
int liWeek;
string ls_week
liWeek = DayNumber(today())
choose case liWeek
case 1
ls_week = "星期天"
case 2
ls_week = "星期一"
case 3
ls_week = "星期二"
case 4
ls_week = "星期三"
case 5
ls_week = "星期四"
case 6
ls_week = "星期五"
case 7
ls_week = "星期六"
end choose
return ls_week