Fwd: Kronolith/Mysql date import problem
kwong@nova.edu
kwong@nova.edu
Mon, 17 Dec 2001 11:33:32 -0500
Quoting Jan Schneider <jan@horde.org>:
>
> Can you give some example data that produces this result? (And post it to
> the Kronolith list)
>
> Jan.
>
Version info:
Kronolith 0.0.3-cvs (from last week)
Horde 3.0 (cvs)
IMP 4.0 (cvs)
PHP 4.1.0
MySQL 4.0.0-alpha
I was doing some very straight forward export and import from the same csv
calendar file generated by kronolith. I got kronolith to import to mysql
database successfully, but the event_start and event_end fields all showed
up as "1969-12-31 xx:xx:xx" in the "kronolith_events" table.
Here's what I did:
1. I created two events through kronolith. No problem.
2. I export all the events to a csv file. No problem.
3. I deleted those two events and then do an import from the
same csv file. No problem.
4. I noticed data.php require me to specify the date format (default is
mm/dd/yy). In the kronolith_events table, default seems to be "yyyy/mm/dd
hh:mm:ss". So, I pick the closest one yy/mm/dd. (I also tried to modify
the csv file from "2001" to "01", same result).
5. When I refresh my calendar, the two events didn't show up in year 2001.
However, when I looked at the "kronolith_events" table, I noticed the
event_start and event_end date both listed as "1969-12-31 19:00:00".
Here's the csv file I got by exporting from kronolith:
------------------------------------------------------
"title","category","location","description","keywords","start_date","start_time","end_date","end_time","alarm","recur_type","recur_end_date","recur_interval",
"recur_data"
"National TST Day","Personal","My
office",,,"2001/12/17","08:00:00","2001/12/17","09:00:00","0","0",,,
"Webmail dead line","Business","My
office",,,"2001/12/18","08:00:00","2001/12/18","09:00:00","0","0",,,
------------------------------------------------------
Here's the output of the kronolith_events table using "
select calendar_id,event_start,event_end from kronolith_events;"
+-----------------+---------------------+---------------------+
| calendar_id | event_start | event_end |
+-----------------+---------------------+---------------------+
| kwong@nova.edu | 1969-12-31 19:00:00 | 1969-12-31 19:00:00 |
| kwong@nova.edu | 1969-12-31 19:00:00 | 1969-12-31 19:00:00 |
+-----------------+---------------------+---------------------+
2 rows in set (0.00 sec)
So, I modified the csv file and replace "2001/12/18" with "01/12/18". After
import, date still showed up as "1969-12-31" in the table. The "kronolith.sql"
I used to create the table is:
CREATE TABLE kronolith_events (
event_id bigint DEFAULT 0 NOT NULL,
calendar_id varchar(255) NOT NULL,
event_description text,
event_location text,
event_keywords text,
event_title varchar(80),
event_category varchar(80),
event_recurtype varchar(11) DEFAULT '0',
event_recurinterval varchar(11),
event_recurdays varchar(11),
event_recurenddate datetime,
event_start datetime,
event_end datetime,
event_alarm int DEFAULT 0,
PRIMARY KEY (event_id)
);
GRANT SELECT, INSERT, UPDATE, DELETE ON kronolith_events TO horde;
flush privileges;
Is it just me again?
James.