Does it exist a function which is similar to time() function of C ambient ?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, i'm working with random number generation, I would like to know if exists, in Matlab, a function like time(0) of C ambient (like emacs) which gives the number of seconds from a certain day.
0 件のコメント
採用された回答
Jan
2017 年 10 月 11 日
編集済み: Jan
2017 年 10 月 11 日
The number of seconds of the current day:
s = rem(now, 1) * 86400;
Number of seconds since 17-Mar-2011:
s = (now - datenum('17-Mar-2011')) * 86400;
This does not use the modern datetime object.
2 件のコメント
Steven Lord
2017 年 10 月 11 日
For datetime:
s2 = seconds(datetime('now')-datetime(2011, 3, 17))
Peter Perkins
2017 年 10 月 13 日
Or for that matter,
>> round(posixtime(datetime('now')))
ans =
1507893971
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!