0

Whenever a program has use of time, the time is inherited from the operating system. My question is, can we set time for current python environment without changing the time in operating system? Any help will be appreciable.

I want to return a custom time instead of time set in the device.

Note: time for every timezone is different, i just want to change the timezone for entire environment, without changing os time.

Millow
  • 11
  • 2
  • 1
    i found this as the accepted answer. https://stackoverflow.com/questions/1398674/display-the-time-in-a-different-time-zone This should work afaik – Quacky dev Jul 27 '21 at 06:02
  • Does this answer your question? [Display the time in a different time zone](https://stackoverflow.com/questions/1398674/display-the-time-in-a-different-time-zone) – Prayson W. Daniel Jul 27 '21 at 06:15
  • yes, i found it quite useful but what i want is, to return a custom time instead of time of system, i.e of os – Millow Jul 27 '21 at 06:27
  • what do you mean by "custom time"? would a time *relative* to the OS time suffice? – FObersteiner Jul 27 '21 at 09:29
  • see, what i'm building is a browser, in js, `new date()` returns the current time, which it takes from the system (os). So I want that it should show a predefined time instead of system time. – Millow Jul 27 '21 at 10:14

0 Answers0