Effacer les filtres
Effacer les filtres

Convert from Microsoft's DateTime Structure to readable date

2 vues (au cours des 30 derniers jours)
Tim
Tim le 11 Juin 2014
Commenté : José-Luis le 11 Juin 2014
I have a dataset with collection intervals marked with numeric identifiers such as the following:
- 635364711700000000 - 635364711800000000 -635364711900000000
These IDs are from Microsoft's DateTime Structure (see link below). Does anybody know if Matlab has functionality to convert from the DateTime Structure to a timestamp in human readable format?

Réponse acceptée

José-Luis
José-Luis le 11 Juin 2014
No, I don't think there is. But if you don't care about leap seconds it is not too complicated:
epoch = datenum(1,1,0);
matlab_time = epoch + MicrosoftTime / (86000 * 10^7); %1 unit Microsoft time = 100 nanoseconds
e.g., taking care of the fact that MicrosftTime should not be stored as double:
datestr(double(datenum(1,1,0) + int64(635364711800000000) / (86400 * 10^7)))
  6 commentaires
Tim
Tim le 11 Juin 2014
That looks great, thanks!
José-Luis
José-Luis le 11 Juin 2014
My pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by