%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Created on 25/05/2018; Version 1.0
% Data used from 'E1_buoy.csv'

% Script to combine date and time from 'load_E1_buoy_data.m' function

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% formats date into eg: 11-Jun-2013, which is a readable date
t.date = datetime(data.date,'InputFormat','yyMMdd');

% formats time into eg: 25-May-2018 11:00:00, matlab automatically sets
%    the date to todays date if no date is specified ((like in  this
%    situation)
t.time = datetime(data.time,'InputFormat','HHmmSS');
 
% isolates the time from the time and todays date created by matlab, as
%    we just require time 
timeofday(t.time);

% combines the date and isolated time into one eg: 11-Jun-2013 11:00:00
t.datetime = t.date + timeofday(t.time);
    