I’m in the ESP8266 Web Server book on page 125.The sample code is:
var todays_date = new Date();
document.getElementById(“dateTime”).innerHTML = todays_date;
The output is:
Fri Mar 19 2021 00:01:55 GMT-0700 (Pacific Daylight Time)
Except that Pacific time zone is GMT-0800 and the clock time is 11:55PM PDT
What’s going on?
I’m not sure what’s the problem.
What web browser are you using to open the file?
Do you have the right data and time set up on your computer?
Can you try to add the following between the <script> tags:
var offset = new Date().getTimezoneOffset(); console.log(offset);
After opening the file in the browser, press CTRL+Shift+J and see what is printed in the console.
The offset = 420
btw – it would be helpful if the login button redirected to this page rather than to an ad 🙂
The result of offset=420 means that your browser assumes that your local time offset is 7 hours and not 8 hours.
When you click on the login button, it redirects to the courses page, right? Do you see something different?
No, but I should.
Fos example, right now I’m on the thread. I got there by clicking the link in the email. Of course, when I arrive here I am not logged in.
It says login to post, so I click login. When I’m done logging in, it should return me to this thread.
In stead, I have to go back to my email, click the link again and then I arrive back here so I can reply. My recollection is that there is an html property called referrer. I i arrive at the login page and the referrer, it should use that as the destination url instead of the courses page, imho.