Closed (won't fix)
Project:
Date
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
31 Mar 2010 at 22:04 UTC
Updated:
22 Dec 2011 at 14:24 UTC
I have an old site which has been upgraded. The event content type has a date field on it which uses the Datestamp storage mechanism. I would like to move away from this and switch to Datetime instead. I can create a new field and adjust the views, but I am wondering if there is an easy way to pull in the values from the existing Datestamp entries. Is there an easy way to do this with a MySQL query?
Thanks ...
Comments
Comment #1
OpenChimp commentedThe FROM_UNIXTIME function looks like it should help. The following query seems to do the format conversion that I need.
SELECT *, FROM_UNIXTIME(field_time_value) AS newdatetimeformat FROM content_field_time;
Now, I guess I just need to figure out the best way to do the UPDATE/INSERT query so that the new datetime field contains all my dates.
This is my datestamp table:
TABLE `content_field_time`
`vid` int(10) unsigned NOT NULL default '0',
`delta` int(10) unsigned NOT NULL default '0',
`nid` int(10) unsigned NOT NULL default '0',
`field_time_value` int(11) default NULL,
`field_time_value2` int(11) default NULL,
This is my datetime table:
TABLE `content_field_datetime`
`vid` int(10) unsigned NOT NULL default '0',
`nid` int(10) unsigned NOT NULL default '0',
`delta` int(10) unsigned NOT NULL default '0',
`field_datetime_value` datetime default NULL,
`field_datetime_value2` datetime default NULL,
The datetime table already seems to have blank values for all the nid's and vid's but obviously not for the deltas. Should I use an update query joined on vid and nid? Or should I delete these empty records and insert from complete records?
Comment #2
pribeh commentedAny luck with this MikeyLikesit? I'm looking to do the same.
Comment #3
arlinsandbulte commentedHi,
I am just indiscriminately closing all support requests with no activity for more than 1 year.
If you consider this to still be a valid issue / support request, feel free to re-open.
BUT,
if you are re-opening this issue, please provide specific details on how this issue can move forward.
Thanks.