date conversion

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mhonmon23
Posts: 76
Joined: 22 Sep 2010, 10:43

date conversion

Post by mhonmon23 »

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.
atrol
Site Admin
Posts: 8553
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: date conversion

Post by atrol »

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
Please use Search before posting and read the Manual
mhonmon23
Posts: 76
Joined: 22 Sep 2010, 10:43

Re: date conversion

Post by mhonmon23 »

Thanks alot atrol
mhonmon23
Posts: 76
Joined: 22 Sep 2010, 10:43

Re: date conversion

Post by mhonmon23 »

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.
partymix
Posts: 30
Joined: 01 Nov 2010, 15:21

Re: date conversion

Post by partymix »

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.
Post Reply