Home > OS >  How does the time function know the current time of the PC? Does it use the Internet to sync with a
How does the time function know the current time of the PC? Does it use the Internet to sync with a

Time:07-24

How does the time function know the current time of the PC? I know how computers know the time. But how does the C time function implemented? Does it use the Internet to sync with a time server as the computers do? Or does it use the internal clock of the computer?

CodePudding user response:

The function returns the current calendar time, which the program got by asking the computer what the current time is.

The function doesn't require internet, just your computer's internal clock :)

If you want to learn more on this topic, I highly recommend reading
Programiz's C-Time.

CodePudding user response:

C asks your device(computer) about the time details and it doesn't require the internet you can check it by disconnecting your device's internet and then running the function

  • Related