Do you know of an XML I can check to get the correct time in London on my Serial Monitor with an Ethernet shield?
I have seen the UdpNtpClient and other Time libraries. I was wondering if there is a simple way to extract this one piece of information like when we use the twitter library to check a twitter accounts most recent tweet?
If there is one that does this for GMT I'll be very happy.
I was wondering if there is a simple way to extract this one piece of information
Which "one piece of information"? The GMT offset for your time zone? It's a constant (unless you are in screwed up part of the world that messes with daylight savings time; what a crock) you could look up and hard-code, unless you plan on taking your Arduino around the world.
The arduino will be based in London. We have daylight savings. This is why I'd like a feed of the time in London coming in. If it auto-updated before I imported it to the Arduino it would save me a lot of time on this project.
Seconds since Jan 1 1900 = 3555836601
Unix time = 1346847801
The UTC time is 12:23:21
It's 13:24 at the moment so it's close enough to Add an hour on (if I can work out how)
but an hour ago when I tried it was saying it was 05:46:32. I don't know why, maybe I put the MAC in wrong?
I'm guessing I add an hour in this section
Serial.print((epoch % 86400L) / 3600); // print the hour (86400 equals secs per day)
Serial.print(':');
if ( ((epoch % 3600) / 60) < 10 ) {
// In the first 10 minutes of each hour, we'll want a leading '0'
Serial.print('0');
BlueJakester, Thank you.I understand this, what I would like is an XML that does change the time to London time to save having to switch it on the arduino every time daylight savings kicks in. Also to save room in my already crowded and confusing sketch.
I think it would be an around useful tool to be able to connect too. would it not? It would save a lot of faffing.
Serial.print(((epoch + 3600) % 86400L) / 3600); // print the hour (86400 equals secs per day)
That worked just fine. I'm still on the hunt for the GMT XML though. As I have no tutors or help with coding other than this forum, I find it very tricky to get my head around the coding. I'm not so good at using different tabs so my code is one page, very long and a nightmare to scroll through.
Trouble is, by the time I've learned how to build the auto updating XMLs I want, they will probably exist already!