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!