z62678667
級(jí)別: 探索解密
精華主題: 0
發(fā)帖數(shù)量: 39 個(gè)
工控威望: 146 點(diǎn)
下載積分: 945 分
在線時(shí)間: 80(小時(shí))
注冊(cè)時(shí)間: 2017-05-18
最后登錄: 2024-09-27
查看z62678667的 主題 / 回貼
樓主  發(fā)表于: 2020-01-04 07:49
圖片:
圖片:
組態(tài)王6.55里生成日?qǐng)?bào)表用到函數(shù)ReportSetHistData和HTConvertTime,但是HTConvertTime只能到2019年。
現(xiàn)在進(jìn)入了2020年,日?qǐng)?bào)表不能正常運(yùn)行了,求助各位大神如何解決?
liwenjiefa
級(jí)別: 探索解密
精華主題: 0
發(fā)帖數(shù)量: 7 個(gè)
工控威望: 127 點(diǎn)
下載積分: 392 分
在線時(shí)間: 339(小時(shí))
注冊(cè)時(shí)間: 2012-01-26
最后登錄: 2024-12-20
查看liwenjiefa的 主題 / 回貼
1樓  發(fā)表于: 2020-01-05 09:19
if (months == 1)
monthsofdays = 0;
if (months == 2)
monthsofdays = 31;
if (months == 3)
monthsofdays = 59;
if (months == 4)
monthsofdays = 90;
if (months == 5)
monthsofdays = 120;
if (months == 6)
monthsofdays = 151;
if (months == 7)
monthsofdays = 181;
if (months == 8)
monthsofdays = 212;
if (months == 9)
monthsofdays = 243;
if (months == 10)
monthsofdays = 273;
if (months == 11)
monthsofdays = 304;
if (months == 12)
monthsofdays = 334;

if (years % 4 ==0 && years % 100 !=0 || years % 400 ==0 && months >=3)
ofdays = yearsofdays + monthsofdays + days;
else
ofdays = yearsofdays + monthsofdays + days - 1;

if (hours >= 8)
ofminites = ofdays * 24 * 60 + (hours - 8) * 60 + minites;

if (hours < 8)
ofminites = (ofdays - 1) * 24 * 60 + (hours + 16) * 60 + minites;

//calculate resultszx;
rest = ofminites * 60 + seconds;