Weird values because of daylight saving time (summer/winter)

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post
User avatar
gizmocuz
Posts: 8560
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Weird values because of daylight saving time (summer/winter)

Post by gizmocuz » Tuesday 08 November 2016 8:58

I know, thats why UTC would solve the DST issue
Quality outlives Quantity!

User avatar
gizmocuz
Posts: 8560
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Weird values because of daylight saving time (summer/winter)

Post by gizmocuz » Tuesday 08 November 2016 12:28

Okey ;) i'm not sure if we need a DST field.... but i will wait your test results
Quality outlives Quantity!

stlaha2007
Posts: 437
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: Weird values because of daylight saving time (summer/winter)

Post by stlaha2007 » Tuesday 08 November 2016 13:43

Please try to look different...
The server is responsible to log the data according to consecutive time ! I.o.w. UTC.
The userview depends on availability of DST (Australians don't know {quote one: "weird behaviour"}) and if the user wants to look with gaps and zigzags or not.

Sorry, that i coded in php and perl, but havent looked at the timelogging and displaytroubles before. But i do understand that it is a user view, like Toulon7559 said.

Sent from my K00C using Tapatalk

User avatar
gizmocuz
Posts: 8560
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Weird values because of daylight saving time (summer/winter)

Post by gizmocuz » Tuesday 08 November 2016 14:35

I dont look at it differently

a) should be correctly logged in the database, without DST, means UTC
b) the presentation to the user should be based on his timezone
Quality outlives Quantity!

stlaha2007
Posts: 437
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: Weird values because of daylight saving time (summer/winter)

Post by stlaha2007 » Tuesday 08 November 2016 14:51

gizmocuz wrote:I dont look at it differently

a) should be correctly logged in the database, without DST, means UTC
b) the presentation to the user should be based on his timezone
Sorry quote didn't come through, actually ment for gordon... i noticed you look at it, like i do, as its supposed to be...

Sent from my K00C using Tapatalk

User avatar
gizmocuz
Posts: 8560
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Weird values because of daylight saving time (summer/winter)

Post by gizmocuz » Tuesday 08 November 2016 20:39

We should store everything in UTC, and then you got 1 standard
Quality outlives Quantity!

stlaha2007
Posts: 437
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: Weird values because of daylight saving time (summer/winter)

Post by stlaha2007 » Tuesday 08 November 2016 23:48

gordonb3 wrote:Okay. Here's your work plan:
  1. rename all tables that have a datetime field with property default=datetime('now'','localtime')
  2. recreate all renamed tables with the UTC default property
  3. copy all data with date convert from the original tables to the new tables
  4. destroy the original tables
  5. change all read references to datetime values in the application to datetime(Date,'localtime') (except in the order by clause)
  6. change all write references to datetime values in the application to datetime(Date,'utc')
  7. pray
Good luck.

PS Do note that this work plan does not change any code behaviour, except for the sort order when querying the shortlog tables. If you followed the steps correctly, which is probably a lot less simple than it seems and why there is a step 7.
I think this looks like how it has to be done. I haven't build these db-tables, have done some webdev with db's before.

Made some mistakes back then. Image Thanks to backup/restore and not having the availability of sites like github, handmade and versioncontrol within Dreamweaver. And before that TurboPascal ;-)

So: Yes it has some/lots of work, i won't say it would be easy.

But hey: It has to be solved, lets go :-)Image

stlaha2007
Posts: 437
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: Weird values because of daylight saving time (summer/winter)

Post by stlaha2007 » Wednesday 09 November 2016 8:58

gordonb3 wrote:
stlaha2007 wrote:But hey: It has to be solved, lets go :-)Image
Care to see the work plan for the easy "solution"?
  1. Alter table [shortlog] add field isdst(byte)
  2. Update table [shortlog] set isdst=(current DST value)
  3. change order by in shortlog queries to 'Date ASC, isdst (DESC if currect DST = 0 | ASC if current DST = 1)'
  4. change inserts to shortlog to include current DST value
I do care to see, and the greater part i understand. As in updating table to include dst active/not active and sorting it based on time with/without dst active state.

Short of saying: fixed the quick and 'dirty' way.

Most coding is done by specialists, i admire that. Thats why i do mostly scriptcoding and contact the specialist for those harder parts.

stlaha2007
Posts: 437
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: Weird values because of daylight saving time (summer/winter)

Post by stlaha2007 » Thursday 10 November 2016 0:12

gordonb3 wrote:Nothing quick and dirty about this actual fix for the DST issue.

Still a lot of source files with references to time functions to plough through .
I do know that... Keep up the good work !!!

OT: Gonna focus on the OTWG-kit. Soldered and hooked up tonight... now implementing the devices and schedules...

I'm just gonna ignore the timeshifts for now, hope its implemented in the next stable before next DST ;-)

User avatar
EddyG
Posts: 228
Joined: Monday 02 November 2015 6:54
Target OS: Raspberry Pi
Domoticz version: 3.9327
Location: Rhenen, Netherlands
Contact:

Re: Weird values because of daylight saving time (summer/winter)

Post by EddyG » Friday 31 March 2017 9:02

Anything new on this item?
Last weekend still some weird values.
Regards,
Eddy

stlaha2007
Posts: 437
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: Weird values because of daylight saving time (summer/winter)

Post by stlaha2007 » Saturday 01 April 2017 8:27

EddyG wrote:Anything new on this item?
Last weekend still some weird values.
Which version are you using? Mine is on 'latest' stable 3.5877. And also have data moved ontop of saterday.

As i recall correctly, it is only fixed in beta after this stable.

User avatar
gizmocuz
Posts: 8560
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi
Domoticz version: beta
Location: Top of the world
Contact:

Re: Weird values because of daylight saving time (summer/winter)

Post by gizmocuz » Saturday 01 April 2017 9:15

Its correct in the beta version
Quality outlives Quantity!

iMartien
Posts: 5
Joined: Wednesday 11 February 2015 12:04
Target OS: Raspberry Pi
Domoticz version: 3.4834
Location: Rotterdam
Contact:

Re: Weird values because of daylight saving time (summer/winter)

Post by iMartien » Monday 30 October 2017 11:03

Just want to confirm this is still an issue in the current stable build...

Btje
Posts: 26
Joined: Wednesday 05 October 2016 7:46
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Weird values because of daylight saving time (summer/winter)

Post by Btje » Wednesday 01 November 2017 9:21

Confirm it is a problem in the current stable.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests