Skip to content

Instantly share code, notes, and snippets.

@Bernix01
Created November 1, 2017 01:39
Show Gist options
  • Save Bernix01/bdaae1604489f33ae9016f86fc56c486 to your computer and use it in GitHub Desktop.
Save Bernix01/bdaae1604489f33ae9016f86fc56c486 to your computer and use it in GitHub Desktop.
CSV date re-formatter
<?php
$data = 'fecha';
$arra = str_getcsv ( $data , "\n" );
foreach($arra as &$Row) {
$Row = str_getcsv($Row, ",");
if($Row[20] != "" && $Row[20] != "fechalect"){
$Row[20] = strftime("%Y-%m-%d %H:%M:%S",strtotime($Row[20]));
}
echo implode (",", $Row)."\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment