view m-toolbox/classes/+utils/@timetools/reformat_date.m @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents f0afece42f48
children
line wrap: on
line source

% REFORMAT_DATE reformats the input date
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: REFORMAT_DATE reformats the input date of the (preferred)
%              form 'yyyy-mm-dd HH:MM:SS' to the format 'mm-dd-yyyy HH:MM:SS'
%              which works with datenum.
%
% CALL:       s  = reformat_date(si)
%
% INPUTS:     si - date string in the format 'yyyy-mm-dd HH:MM:SS'
%
% OUTPUTS:    s  - date string in the format 'mm-dd-yyyy HH:MM:SS'
%
% EXAMPLE:    dnum = datenum(reformat_date('2007-05-04 22:34:22'));
%
% VERSION: $Id: reformat_date.m,v 1.1 2008/08/05 18:07:59 ingo Exp $
%
% HISTORY: 03-06-2007 M Hewitson
%             Creation
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function s = reformat_date (s)

  % reformt string to stupid matlab format MM-DD-YYY
  s=strcat(s(6:10),'-',s(1:4),s(11:length(s)));

end