Jump to content

Convert Unix Timestamp


unemployment

Recommended Posts

DATE_FORMAT(`info`.`last`, '%W, %D \of %M %Y') AS '2',  fails on me.  I think it is because info.last is a unix timestamp.  If that is the issue, then can someone please tell me how to convert it properly.

 

$sql[$x] = "SELECT
                    'pm_conversations' AS `table`,
                    `pm_conversations`.`conversation_id` AS `row_id`,
                    `pm_conversations`.`conversation_subject` AS `0`,
                    `info`.`total` AS '1',
                    DATE_FORMAT(`info`.`last`, '%W, %D \of %M %Y') AS '2',
                    '' AS '3',
                    '' AS '4',
                    '' AS '5',
                    '' AS '6',
                    '' AS '7',
                    '' AS '8',
                    '' AS '9',
                    '' AS '10',
                    '' AS '11',
                    '' AS '12',
				'' AS '13'
                FROM `pm_conversations_users`
                INNER JOIN (
                    SELECT
                        `conversation_id`,
                        COUNT(`conversation_id`) AS `total`,
                        MAX(`message_date`) AS `last`
                    FROM `pm_messages`
                    GROUP BY `conversation_id`
                ) AS `info`
                ON `pm_conversations_users`.`conversation_id` = `info`.`conversation_id`
                INNER JOIN `pm_conversations`
                ON `pm_conversations_users`.`conversation_id` = `pm_conversations`.`conversation_id`
                WHERE (`pm_conversations_users`.`user_id` = {$GLOBALS['user_info']['uid']}
                AND `conversation_subject` LIKE '%{$messages_subject}%'
                AND `pm_conversations_users`.`deleted` = 0)";

Link to comment
https://forums.phpfreaks.com/topic/242354-convert-unix-timestamp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.