从数据转储中将多个unix时间戳转换为dd/mm/yyyy


convert multiple unix timestamps to dd/mm/yyyy from a data dump

我有一个成员列表的转储,其中有7000个用户,其加入日期和订阅日期采用unix时间戳格式。问题是我需要将这些成员导入到一个新的会员软件中,该软件的日期为dd/mm/yyyy格式。现在,如果已经使用对来自mysql数据库的单个值进行了这样的转换

$datetime = strtotime($row->createdate);
$mysqldate = date("m/d/y g:i A", $datetime);

但是,如何转换字符串之间的近14000个这样的时间戳呢?我能做些什么吗?

转储的一部分

memberid,"identid","loginid","networkid","refurl_lookup_id","status","trial","joined","expired","last_login","stamp","siteid","username","password","cryptpass","ip","email","session","mailok","flat_price","first_login","third_party_partner_id","cascadeid","cascade_item_id","token","original_username","renamed","marked","token_hash","firstname","lastname","address1","address2","zip","city","country","state","shipping_firstname","shipping_lastname","shipping_address1","shipping_address2","shipping_zip","shipping_city","shipping_country","shipping_state","phone","xsell_success","xsell_message","custom1","custom2","custom3","custom4","custom5","last_modified","member_subscription_id","memberidx","billerid","statid","cost","cost_charge","spent","refunded","charges","next_rebill","optionid","rebills","active","upgradeid","expires","nats_expires","biller_expires","original_optionid","created_date","loginid_assigned","identid_assigned","gateway_token","campaignid","programid","tourid","adtoolid","subid1","subid2","countryid","promotionalid","loginid_nice"
7719,"26","0","0","27426","1","0","1398029330","0","1398797388","1398029330","1","torsten55","netsrot55","9dlO.AEZY3LpY","44776524","sds@googlemail.com","79ab391dc0873b7e18c63637d10d4a41","1","0","1398029433","0","1","1","0","sdsd","0","0","fb1d7da87c445cdfb59f241bd7e29dfe","dsd","Dietz","Karl-Liebknecht-Ring 22","","01612","Nuenchritz","DE","XX","","","","","","","","","","0","","","","","","","0","9866","CCBILL:02141107010sdsd","1","553543b62e8977","0","571","3938","0","1","1400707730","2","0","1","","1400707730","1400707730","0","2","1398029154","0","0","","0","0","1","0","0","0","0","0","Type-In"
7816,"45","0","0","30667","1","0","1398609314","0","1398797233","1398609314","1","Phantom183","MXU146","ac7Jo.tfvdJ5o","1573202729","rolex0@freenet.de","c29c6032ed3867b70ec7ec25749a1fde","1","0","1398609530","0","1","1","0","rolex","0","0","9446bf3e08c2e628cf449756ba92a9cb","sddso","Nasdal","BAhnhofstraße","","03046","Cottbus","DE","XX","","","","","","","","","","0","","","","","","","0","10043","CCBILL:021411770100000sd","1","5535d1545cd3f9","0","380","2627","0","1","1401287714","1","0","1","","1401287714","1401287714","0","4","1398609221","0","0","","0","0","4","0","0","0","0","0","Type-In"

只是一个主要从手册中复制的基本示例:

if (($handle = fopen("olddump.csv", "r")) !== FALSE) {
    $fp = fopen('newdump.csv', 'w');
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        // Do this for each date field
        $data[7] = date('d/m/Y', $data[7]); // joined
        $data[9] = date('d/m/Y', $data[7]); // last_login
        // etc...
        fputcsv($fp, $data);
    }
    fclose($handle);
    fclose($fp);
}