Server time is out? - Page 1
Forum section: electronics / general

author: kolbep
author_rank: Frequent Contributor
timestamp: January 14, 2014, 05:06:30 am
content: Is it just me, or is the servers time wrong.It is showing 14 August 18:03,But it is only 07:06am in RSA, or 05:06am gmt

author: rolandpenplotter
author_rank: Regular Contributor
timestamp: January 14, 2014, 05:08:07 am
content: Quote from: kolbep on January 14, 2014, 05:06:30 amSet your time zone in:https://www.eevblog.com/forum/profile/?area=forumprofileTa daa! Fixed

author: Monkeh
author_rank: Super Contributor
timestamp: January 14, 2014, 05:17:12 am
content: The server's timezone is, annoyingly, set to eastern Australia. But worse! It follows their DST, too. So, on March 30th I'll have to adjust my timezone. And then I'll have to adjust it again on April 6th when DST in Australia ends.C'mon Dave, be logical, set the clock to UTC and leave it.And no, Roland, setting your country does not set the clock.

author: kolbep
author_rank: Frequent Contributor
timestamp: January 14, 2014, 05:27:38 am
content: I have not changed anything, and I could have sworn the times used to correspond for me.Maybe Dave hooked his Fluxgate Condensor up to the server, causing a rift in the space time continum (how do you spell kon teen you um?)

author: peter.mitchell
author_rank: Super Contributor
timestamp: January 14, 2014, 03:52:37 pm
content: It's in the look and feel tab of your forum profile, you just set an offset from forum time.Profile>forum profile>modify profile (the orange button) >look and feel>time offset.

author: gnif
author_rank: Unknown
timestamp: January 14, 2014, 04:34:08 pm
content: Quote from: Monkeh on January 14, 2014, 05:17:12 amThe server does work in UTC and has the locale set to AEST, if there is timezone issues it is because SMF is not correctly using the date/time API, not due to server configuration.

author: Monkeh
author_rank: Super Contributor
timestamp: January 14, 2014, 07:14:28 pm
content: Quote from: gnif on January 14, 2014, 04:34:08 pmConsidering the purpose of the server, I'd consider setting the timezone to Sydney and screwing up the application a server configuration problem..

author: ttp
author_rank: Regular Contributor
timestamp: January 15, 2014, 04:58:44 am
content: AEST is Sydney timezone - Australian Eastern Standard Time if I remember correctly.

author: gnif
author_rank: Unknown
timestamp: January 15, 2014, 11:01:15 am
content: Quote from: Monkeh on January 14, 2014, 07:14:28 pmOk, obviously you have no idea how complex Linux handles time. The RTC is ALWAYS in UTC, the 'time' syscall ALWAYS returns a UTC timestamp... PHP provides a set of APIs for localising the time to the visitors time zone (gmdate, strtotime with timezone suffix, etc). PHP will default to AEST and it is up to the website to either ignore that and deal strictly in UTC (which any decent website does).If we were to switch it to UTC, it would affect all the timestamps on the server, not just the blog. Dave's word press site for example would start showing UTC dates instead of the AEST date, which is more correct to what he is posting, as he posts in the AEST timezone.Put simply, the server is configured correctly according to set standards, it is not the server's fault if the application layer code (SMF) does not leverage the API correctly. In short, you want it fixed, lodge a bug report with SMF.

author: Monkeh
author_rank: Super Contributor
timestamp: January 15, 2014, 11:14:34 am
content: Quote from: gnif on January 15, 2014, 11:01:15 amCheers for taking the dick attitude and assuming I know nothing. I'm well aware how Linux handles time. Individual software is another matter.QuoteAnd clearly WP and SMF do not. Not usually a problem, as the locale is normally set to UTC.QuoteAnd AEST timestamps are useless to me, especially as the timezone isn't indicated.QuoteI disagree. I personally, and very few I've worked with, would set the timezone to anything but UTC. If there is some standard indicating servers should have their timezone arbitrarily set to that of the owner half way around the planet, I'm curious to read it.QuoteAnd Wordpress, too, apparently. I will admit the big failing here is SMF's handling of timezones.

author: arekm
author_rank: Unknown
timestamp: January 15, 2014, 12:38:45 pm
content: Quote from: gnif on January 15, 2014, 11:01:15 amJust tiny correction. Above statement is false. You can set it to be UTC or local if you wish. Linux can deal with both variants.man hwclock:" Line 3: "UTC" or "LOCAL". Tells whether the Hardware Clock is set to Coordinated Universal Time or local time. You can always override thisvalue with options on the hwclock command line."

author: gnif
author_rank: Unknown
timestamp: January 17, 2014, 05:01:31 pm
content: Quote from: arekm on January 15, 2014, 12:38:45 pmI am sorry, yes, you can do this, but the default of pretty much every major distribution is to configure the RTC for UTC, most even now omit the option during install and just assume UTC.QuoteI did not assume you know nothing, I assumed that you did not understand the issue completely. It is up to the application layer to decide if it is going to work in UTC or the servers local timezone, or even change the timezone it is working in by calling thetzsetas is clearly documented.PHP exposes this functionallityand the web application should take advantage of it.QuoteUseless to you, but not those of us that live in the timezone and have to manage the server.QuoteIt is your right to disagree, but you must realise that pretty much every web server configured prompts for the time zone on installation, even applications such as cPanel insist that the time zone is configured correctly on initial install. Any software package that is intended to be distributed onto unknown hardware in unknown time zones with unknown configurations MUST be able to handle these things correctly.I am coming from a background of managing hosting environments for well over 800 servers over the past 15 years, the biggest complaint we get when taking over management for a client is that their timestamps are all screwed up, database functions in UTC, but PHP working in some random time zone. Application developers that are working with dates/times NEED to bother to learn how to set the time zone correctly, and how to pass UTC timestamps between application layers no matter what the systems time zone is configured as.Long story short, the server is configured correctly, this is a SMF bug, and should be lodged as one. Changing the servers timezone to "fix" the bug would just be a hack and hide the real issue. That said, I will have a dig through the SMF code and see if I can identify the issue and fix it properly.

author: Monkeh
author_rank: Super Contributor
timestamp: January 17, 2014, 05:13:05 pm
content: I don't disagree that both SMF and WP are at fault here. I still cannot agree with setting a local timezone on a server. It gets daft when you're working on machines owned by people in five different timezones who all insist on using their local timezone.Any tool (cPanel, for example) which doesn't recognise UTC as a valid choice is fundamentally fucked. That kinda goes without saying for cPanel, though.

author: gnif
author_rank: Unknown
timestamp: January 17, 2014, 05:25:16 pm
content: Quote from: Monkeh on January 17, 2014, 05:13:05 pmEither way, I have had an initial look through the code since I made my last post, SMF actually does try to set the timezone to whatever it is configured as by the forum administrator... but it does not in any way support proper timezone date correction for users. They have added a stupid hour offset thing that you have to configure yourself, and like you said, it will get screwed up with DST. This is all correctable though since the dates are stored in the database as a UNIX timestamp (UTC), a simple hack to SMF that would make sense would be to make the time offset setting apply to the UTC time, not the localised time. A proper hack would be to add a time zone option to the profile, and call the default timezone function appropriately.Please note that I am not trying to say that this is not an issue, I will do what I can to fix it for you (fork and patch), but I will not adjust the server's time zone to work around a software bug.

author: Monkeh
author_rank: Super Contributor
timestamp: January 17, 2014, 05:28:36 pm
content: It would also be almost unlawfully logical for timestamps to be displayed in UTC when not logged in (for both SMF and WP).

author: gnif
author_rank: Unknown
timestamp: January 17, 2014, 05:37:47 pm
content: Quote from: Monkeh on January 17, 2014, 05:28:36 pmI somewhat agree here, but from looking at the code, it is up to Dave to set this option in the wordpress/SMF settings interface, his call on that one.

author: kolbep
author_rank: Frequent Contributor
timestamp: January 17, 2014, 08:31:14 pm
content: Oi Vey!!!I really did not think that my post would create 15 replies already.The thing that started this off, was, that I tried to go on to eevblog forum 5 minutes before creating the topic.when I tried, I got a server error, but then refreshed, and could get in.I thought maybe the server had a hickup, so I decided to check when the last posts were made, just to see if it had been lff for long.When I noticed timestamps in the future, I thought maybe the server had restarted, and messed its rtc.I think I never really noticed the timestamps previously, so I automatically assumed that it must have been locked to my timezone before. But as you have examined the source, there was no way that coukd have been the case.When I was the head IT tech for a local ISP (about 6 years ago), when setting up linux servers, cisco routers, and portmasters, we set the bios to the local time, and then during configuration, just told it we were gmt+2 for the timestamping.We did not have an international clients, so different timezones were not really an issue.

author: kolbep
author_rank: Frequent Contributor
timestamp: January 17, 2014, 08:33:38 pm
content: It isn't really bothering me, just that it would be a nice to have feature,so if it is gonna be a mission, or if it is gonna break other things, or add to your workload,then please leave it as is.