Increase hour ... how to work with date and time ?

ek3ekytop

Client
Регистрация
09.03.2012
Сообщения
111
Благодарностей
17
Баллы
18
HI to all. I need to create post scheduling bot and need to schedule posts in this format 02/20/2019 3:55PM and adding post in 3 hours interval. Is there easy way this to be done?
 

ek3ekytop

Client
Регистрация
09.03.2012
Сообщения
111
Благодарностей
17
Баллы
18
Anyone?
Is there some easy way to do it or I need create variables for hour, minute ... so on and increase them on every loop .... If this is the only one solution how it will work correctly for the days of the current month ???
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113
Like this:
Schedule_3h.png
 

ek3ekytop

Client
Регистрация
09.03.2012
Сообщения
111
Благодарностей
17
Баллы
18
Yes just like this, but i need to fill up website queue. For this purpose I need to have external texts like this :

02/20/2019 3:55PM
02/20/2019 6:55PM
02/20/2019 9:55PM
.....
02/21/2019 3:55PM
02/21/2019 6:55PM
........
Is there some way to start from local time and then to increase hours and days .. etc ...
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
You can make your scheduler in .txt file for example.

Enter all this one per line:

02/20/2019 3:55PM
02/20/2019 6:55PM
02/20/2019 9:55PM
.....
02/21/2019 3:55PM
02/21/2019 6:55PM

Then run Your bot in loop SET execution -1 then take first line from file. Compare if this time is higher then actual time.
If higher then time is past and You should execute Your bot, if not higher then just end it with error for example.
 
  • Спасибо
Реакции: ek3ekytop

ek3ekytop

Client
Регистрация
09.03.2012
Сообщения
111
Благодарностей
17
Баллы
18
Thanks for your suggestion, but I need to input day , hour etc in different places so I think I need to create variables for them and increase variable number on every loop.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Thanks for your suggestion, but I need to input day , hour etc in different places so I think I need to create variables for them and increase variable number on every loop.
Not sure what You mean with different places, but in file it will work just like in scheduler and in correct way.
If You are going to keep Your projects running in loop like many hours then expect to get huge memory leak as if You keep browser opened it eats more and more RAM.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)