- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
private int MsUntilNextRefresh(DayOfWeek refreshDay, uint refreshHour)
{
int days = 0;
if (DateTime.Now.DayOfWeek > refreshDay)
days = refreshDay + 7 - DateTime.Now.DayOfWeek;
else if (DateTime.Now.DayOfWeek < refreshDay)
days = refreshDay - DateTime.Now.DayOfWeek;
else
days = 7;
int hours = 0;
if (DateTime.Now.Hour > refreshHour)
{
days--;
hours = (int)refreshHour + 24 - DateTime.Now.Hour;
}
else if (DateTime.Now.Hour < refreshHour)
{
hours = (int)refreshHour - DateTime.Now.Hour;
}
return days * 86400000 + hours * 3600000 - DateTime.Now.Minute * 60000 - DateTime.Now.Second * 1000 - DateTime.Now.Millisecond;
}
hometwo 07.05.2014 12:41 # −7
brutushafens 07.05.2014 13:00 # −7
bormand 07.05.2014 13:12 # +4
eth0 07.05.2014 18:46 # +5
3.14159265 07.05.2014 21:19 # 0
hometwo 07.05.2014 13:13 # −7
bormand 07.05.2014 13:12 # 0
Этот скрипт ровно в 00:00:00 запускается?
valery_chistyakov 07.05.2014 14:15 # −1
> dtnow.Date. ....