How to input a variation of datenum(now)?
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
I am trying to create a variation of the datenum(now) command with a twist, the code must output the time as if I typed it at 7am.
I am proceding the following way,
 datestr(round(datenum(now)), 'ddd dd/mmm HH:MM PM ')
with output
 ans =
 Thu 11/Oct 12:00  AM
I want a variation of this code that outputs the folliowing for whenever I type it
 ans =
 Thu 11/Oct 7:00  AM
Output the current day and month of the input, but the time must always be 7am of the current day
Can you please help?
댓글 수: 0
채택된 답변
  per isakson
      
      
 2012년 10월 10일
        Hint:
    datestr( floor(now) +7/24, 'yyy-mm-dd HH:HH:SS' )
returns
    ans =
    2012-10-10 07:00:00
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

