lingling
2025-03-07 1b33c9c58b57bde6b60de30dfc8727132b92829d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace LifePayment.Worker;
 
public static class PeriodTool
{
    public static int CalcuPeriodFromEveryDayTime(int doWorkHour, int doWorkMinute, int doWrokSecond)
    {
        var now = DateTime.Now;
        var doWorkDateTime = now.Date.AddHours(doWorkHour).AddMinutes(doWorkMinute).AddSeconds(doWrokSecond);
 
        if (now >= doWorkDateTime)
        {
            doWorkDateTime = doWorkDateTime.AddDays(1);
        }
 
        return (int)(doWorkDateTime - now).TotalMilliseconds;
    }
 
 
}