Hi,
I posted this http://www.mantisbt.org/forums/viewtopi ... =3&t=12010 and I'm able to upgrade mantis 1.1.4 to 1.2.3.
While checking the changes, I noticed that the DATES data type change to integer and changed data to timestamp equivalent.
What I need is, a procedure that the mantis 1.2.3 use to do this. I need it because we got a lots of customize in mantis and I would like
to follow the mantis did in the database.
to summarize, I need a fastest procedure that will convert and stored data with datetime datatype to timestamp as integer.
date conversion
Moderators: Developer, Contributor
Re: date conversion
have a look at function install_date_migrate in file admin/install_functions.php
Have also a look at this issue how to change it another way
http://www.mantisbt.org/bugs/view.php?id=12357
Have also a look at this issue how to change it another way
http://www.mantisbt.org/bugs/view.php?id=12357
Re: date conversion
Hi atrol,
This might help to others. please check and advise if you recommend this.
//add timestamp date handler
ALTER TABLE `mantis_bug_history_table`
ADD COLUMN `date_modified_temp` int(10) NULL DEFAULT 0 AFTER `type`;
//Now update the data
update mantis_bug_history_table
set date_modified_temp = UNIX_TIMESTAMP(mantis_bug_history_table.date_modified)
where date_modified_temp = 1
Hope this make sense and help others.
This might help to others. please check and advise if you recommend this.
//add timestamp date handler
ALTER TABLE `mantis_bug_history_table`
ADD COLUMN `date_modified_temp` int(10) NULL DEFAULT 0 AFTER `type`;
//Now update the data
update mantis_bug_history_table
set date_modified_temp = UNIX_TIMESTAMP(mantis_bug_history_table.date_modified)
where date_modified_temp = 1
Hope this make sense and help others.
Re: date conversion
A quick solution that I used was to make an excel sheet with the following information:
Column 1: <?php echo strtotime("
Column 2: Date (example:10/28/2010)
Column 3: Time (Example: 1:48 PM)
Column 4: "); ?><br>
I then copied all of my dates and pasted them into the "date" column. After this, All of my times and pasted them into my "time" column.
Using my example date and time..this creates for each line " <?php echo strtotime("10/28/2010 1:48 PM"); ?><br>
I then copy all 4 columns and however many rows of data I have and paste them into a convert.php webpage.
I then go to localhost/convert.php and copy all the resulting timestamps.
You can then use all of these to replace all dates and times with a time stamp.
Column 1: <?php echo strtotime("
Column 2: Date (example:10/28/2010)
Column 3: Time (Example: 1:48 PM)
Column 4: "); ?><br>
I then copied all of my dates and pasted them into the "date" column. After this, All of my times and pasted them into my "time" column.
Using my example date and time..this creates for each line " <?php echo strtotime("10/28/2010 1:48 PM"); ?><br>
I then copy all 4 columns and however many rows of data I have and paste them into a convert.php webpage.
I then go to localhost/convert.php and copy all the resulting timestamps.
You can then use all of these to replace all dates and times with a time stamp.