求一个 在手机屏幕上显示网络时间的程序
autojs吧
全部回复
仅看楼主
level 3
Si-T 楼主
求一个 在手机屏幕上显示网络时间的程序 [柯基暗中观察][柯基暗中观察]
2019年12月10日 14点12分 1
level 11
是待机的屏幕,还是正在使用的。
2019年12月11日 12点12分 2
正在使用的
2019年12月14日 08点12分
level 3
// 此代码由飞云脚本圈http://www.feiyunjs.com整理提供 【悬浮显示时间】[吐舌]
//autojs编写脚本时,格式化时间的写法
var window = floaty.rawWindow(
<vertical bg="#88008800">
<text id="text" textSize="20sp"/>
</vertical>
);
window.setTouchable(false);
window.setPosition(100, 100);
setInterval(() => {
ui.run(() => {
window.text.setText(new Date().Format("yyyy-MM-dd hh:mm:ss"));
});
}, 50);
// author: meizz
Date.prototype.Format = function(fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
2020年02月09日 06点02分 5
1