jdiazbb / rfxcmd

Automatically exported from code.google.com/p/rfxcmd
1 stars 0 forks source link

Dates are recorded in database at local time, should be recorded as UTC timestamps #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run rfxcmd.py with -m option
2. Check database content : select datetime from weather;

What is the expected output? What do you see instead?

$ date
lundi 28 janvier 2013, 21:55:51 (UTC+0100)
$ date -u
lundi 28 janvier 2013, 20:55:54 (UTC+0000)
$ mysql -u rfxcom -p rfxcom
mysql> select datetime from weather;
+---------------------+
| datetime            |
+---------------------+
| 2013-01-28 21:47:41 |
| 2013-01-28 21:48:37 |
| 2013-01-28 21:49:36 |
| 2013-01-28 21:50:33 |
| 2013-01-28 21:52:31 |
+---------------------+
5 rows in set (0.01 sec)

What version of the product are you using? On what operating system?

Release 0.22 on Linux Debian Squeeze

Please provide any additional information below.

A good practice is to record timestamps at UTC format rather than local time, 
so that:
 1. It is possible to convert timestamps to other, different, timezone formats
 2. Daylight saving times do not scramble ordered results

I may suggest to record a real Unix UTC timestamp in DB (i.e. 1359407325 for 
'GMT: Mon, 28 Jan 2013 21:08:45 GMT' or in my own time zone 'lundi 28 janvier 
2013 22:08:45 GMT+1'), and optionally a datetime value in local time zone, as 
currently made, for convenient and human-readable display.

BTW: great job so far, really useful program, I'd like to contribute :)

Original issue reported on code.google.com by vbouil...@gmail.com on 28 Jan 2013 at 9:14

GoogleCodeExporter commented 8 years ago
This will be introduced in the version 0.3, when the database structure will 
change. There will be no changes in the existing 0.2x database.

Original comment by sebastia...@gmail.com on 9 Mar 2013 at 10:56

GoogleCodeExporter commented 8 years ago

Original comment by sebastia...@gmail.com on 17 Mar 2013 at 9:03

GoogleCodeExporter commented 8 years ago
This is included in 0.3 and released as Alpha-1 release, can be found here 
http://rfxcmd.googlecode.com/files/rfxcmd-v03-alpha1.zip for testing.

Original comment by sebastia...@gmail.com on 18 May 2013 at 12:44