I am aware of the datetime library. However, on top of knowing the date and time of the world, I also need to know the date and time of the local server my application will be running on. The reason for this is because my local server is not connected to the internet so it may have a different date and time and I want to be able to detect it if that's the case. Any help would be appreciated.
In python how can I get the date and time of my local server?
6.2k views Asked by Zarif Akhtab At
2
With the
datetime
package, as you refer to, you can get the current local time e.g. byThis is the local time on the machine. Python does not reach out to the world over the internet to ask what time it is.