How to find the absolution date?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Benson Gou
am 9 Jun. 2020
Kommentiert: Benson Gou
am 9 Jun. 2020
Dear All,
I think it is hard to find out the absolute date (current date). Because the computer date can be changed, for example, today is June 09, 2020, if I run datetime, it could find June 09, 2020. But if I change my computer date to 09 May 2020, datetime will give me 09 May 2020 which is Not the correct date of today. Is there a way to solve this problem?
Thanks a lot.
Benson
0 Kommentare
Akzeptierte Antwort
David Hill
am 9 Jun. 2020
A simple search showed several possible solutions.
s1 = webread('https://tycho.usno.navy.mil/cgi-bin/timer.pl');
s2 = regexp(s1, '<BR>(.*)\sUTC','tokens','once');
t = datetime(s2,'InputFormat','MMM. dd, HH:mm:ss');
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!