Формат MATLAB DateNumber
: количество дней, прошедших с 0 января 0000 года. Вы можете использовать toUTCString
Java с некоторыми изменениями:
var d = new Date(dateMATLAB*86400000-62167305600000);
var n = d.toUTCString();
Где dateMATLAB
- дата MATLAB вывод. Значение 62167305600000
- это число миллисекунд, которое прошло между 0 и 1970 годами. Используя ваш пример,
var d = new Date(732161.8561226851*86400000-62167305600000);
var n = d.toUTCString();
Выведет
Mon, 02 Aug 2004 20:32:48 GMT
Если у вас нет возражений против создания и запуска stored procedure
в базе данных, вы можете сделать это полностью без использования PHP.
create procedure `speditalltables`()
begin
declare _strsql varchar(512);
declare _table varchar(128);
declare done int default false;
declare res integer default 0;
declare _cursor cursor for select `table_name` as 'name'
from `information_schema`.`tables`
where `table_type`='base table' and `table_schema`=database();
declare continue handler for not found set done=true;
open _cursor;
repeat
fetch _cursor into _table;
if not done then
/* different column names ~ edit as appropriate */
set @strsql=concat("update `",database(),"`.`",_table,"`
set
`filepath`=replace( `filepath`, '/uploads/', '/files1/' ),
`filepath2`=replace( `filepath`, '/uploads/', '/files1/' ),
`filepath3`=replace( `filepath`, '/uploads/', '/files1/' ),
`filepath4`=replace( `filepath`, '/uploads/', '/files1/' )");
prepare stmt from @strsql;
execute stmt;
deallocate prepare stmt;
end if;
until done end repeat;
close _cursor;
select 'finished' as 'result';
set done=null;
set @res=null;
set @_table=null;
end