Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRCTC Clock is 10 Seconds Ahead #48

Open
ketankolte7 opened this issue May 4, 2024 · 6 comments
Open

IRCTC Clock is 10 Seconds Ahead #48

ketankolte7 opened this issue May 4, 2024 · 6 comments

Comments

@ketankolte7
Copy link

ketankolte7 commented May 4, 2024

Please verify the same. Can cause problem while booking Tatkal tickets.
@shivamguys

@shivamguys
Copy link
Owner

i see what you are saying but the time you see in the website is the mixture of local clock and then clock from backend sync.
Whenever you book something irctc checks the time in its backend to ensure nothing is manipulated.

See i changed my system time to 1 hour late but actual time is the time i am posting this message.

image

@ketankolte7

@ketankolte7
Copy link
Author

ketankolte7 commented May 9, 2024

image

in the image you can see the difference. At the Tatkal time, it is clicking on refresh button 10 second earlier. thats why it igoes into loading state. And after it founds booking not started yet. Then it clicks again. After that it starts. But in that 1 minute is already getting lost.

Can you please verify that. As I have tried 2 times at tatkal time still same problem.

( If we calculate exact then it is a 7 sec difference ). Also you can verify in mobile as well.

@shivamguys
Copy link
Owner

Cool i will then fix it to use system time to check whether tatkal time has been crossed or not then it will click....

@NoelJacob
Copy link

Then is it possible to start booking 7 seconds in advance?

@ketankolte7
Copy link
Author

ketankolte7 commented May 10, 2024

I tried with 8 seconds as tatkal starts at 10:00:00 so i kept the time as 10:00:08 in code and also added code for seconds so after clicking it is throwing error as booking is not started yet. So need to find the exact time at which we can click

@balajha
Copy link

balajha commented Jul 30, 2024

@shivamguys kindly update in the code for the 08 second for eg- 10:00:08,, 11:00:08
some thing like this. while updating 8 second in tatkal second automatically refresh by the given time but it doesn't run after that code stopped. Due to the 8 second . Gets the probability for getting a waiting ticket.

export const tatkalOpenTimings = {
"2A": "10:00:08",
"3A": "10:00",
"3E": "10:00",
"1A": "10:00",
"CC": "10:00",
"EC": "10:00",
"2S": "11:00",
"SL": "11:00:08",
}

export const hasTatkalAlreadyOpened = (TRAIN_COACH) => {
const openTime = tatkalOpenTimings[TRAIN_COACH]
const targetTime = dayjs().set('hour', openTime.split(':')[0]).set('minute', openTime.split(':')[1]).set('second', 0)
const currentTime = dayjs()
return currentTime.isAfter(targetTime);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants