Date and Hour Vector extraction
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everybody! I have a vector of doubles representing date and hour. Example
DateTime=[207199500
207199501
207199502
207199503
207199504
207199505...]
now i would like to convert it into a date vector and vector with hour values. Example for first entry: 20-07-1995 and 01:00. Can someone help? thanks
2 Kommentare
Antworten (1)
Arnab Sen
am 29 Apr. 2016
Hi hdiba,
For a sample datetime you can compute as following script. The same script should work for a Date Time vector as well.
>> dt=207199501
>> Time=mod(dt,100);
>> dt=floor(dt/100);
>> Year=mod(dt,10^4);
>>dt=floor(dt/10^4);
>>month=mod(dt,100);
>>day=floor(dt/100);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!