Dates and Time
日期和时间数据类型约会时间
,duration
, 和calendarDuration
support efficient computations, comparisons, and formatted display of dates and times. Work with these arrays in the same way that you work with numeric arrays. You can add, subtract, sort, compare, concatenate, and plot date and time values. You also can represent dates and times as numeric arrays or as text. For more information, seeRepresent Dates and Times in MATLABor watch日期和时间阵列.
fonctions
rubriques
- Represent Dates and Times in MATLAB
利用
约会时间
存储日期和时间信息的阵列。这些阵列支持算术,排序,比金宝app较,绘图和格式化显示。 - Compare Dates and Time
You can perform an element-by-element comparison of values in two
约会时间
阵列或两个duration
使用关系操作员的数组,例如>
和<
. - Set Date and Time Display Format
The
格式
property on约会时间
,duration
, 和calendarDuration
数组controls the display of values in each array. You can change the value of this property. Changing the格式
property does not change the values in the array, only their display. - Specify Time Zones
When you create a datetime, it is unzoned by default. If you work with datetime values from multiple time zones or need to account for daylight saving time, you might need to specify a time zone.
- 跨语言的共享代码和数据
共享与MATLAB处理日期和时间的代码时遵循这些最佳实践®其他地区的用户。写和阅读其他当地人的日期。
- Core Functions Supporting Date and Time Arrays
Many functions in MATLAB operate on date and time arrays in much the same way that they operate on other arrays.
résolutiondesproblèmes
Carryover in Date Vectors and Strings
如果元素不超出传统范围,则MATLAB调整了该日期向量元素和上一个元素。
Converting Date Vector Returns Unexpected Output
由于日期向量是数字的1 x-6向量,因此Datest
可能会将您的输入日期向量解释为串行日期编号的向量,或将序列日期编号解释为日期向量,并返回意外的输出。