view m-toolbox/classes/+utils/@timetools/reformat_date.m @ 3:960fe1aa1c10 database-connection-manager

Add LTPDADatabaseConnectionManager implementation. Java code
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +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