tzoffset
相对于 UTC 的时区偏移量
说明
示例
求出时区偏移量
以纽约市对应的时区创建一个 datetime
数组。
t1 = datetime('today','TimeZone','America/New_York'); t = dateshift(t1,'end','month',[1:3:9])
t = 1x3 datetime
30-Sep-2023 31-Dec-2023 31-Mar-2024
求出每个日期时间值与 UTC 的时区偏移量及其夏令时时间偏移。
[dt,dst] = tzoffset(t)
dt = 1x3 duration
-04:00 -05:00 -04:00
dst = 1x3 duration
01:00 00:00 01:00
输入参数
t
— 日期时间输入
datetime
数组
日期时间输入,指定为 datetime
数组。
输出参数
dt
— 相对于 UTC 的时区偏移量
标量 | 向量 | 矩阵 | 多维数组
相对于 UTC 的时区偏移量,以标量、向量、矩阵或多维 duration
数组形式返回。dt
的大小与 t
相同。
dst
— 夏令时的时差
标量 | 向量 | 矩阵 | 多维数组
夏令时的时差,以标量、向量、矩阵或多维 duration
数组形式返回。dt
的大小与 t
相同。值 01:00
指示 t
中的对应日期时间发生在夏令时期间观测它的位置。对于不遵守夏令时的位置,dst
数组的元素均为 00:00
。
扩展功能
tall 数组
对行数太多而无法放入内存的数组进行计算。
此函数完全支持 tall 数组。有关详细信息,请参阅 tall 数组。
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
此函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
分布式数组
使用 Parallel Computing Toolbox™ 在集群的组合内存中对大型数组进行分区。
此函数完全支持分布式数组。有关详细信息,请参阅Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox)。
版本历史记录
在 R2014b 中推出
另请参阅
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)