TimeObject
✖
TimeObject
更新 14.1

更多信息和选项


- TimeObject[] 使用您的计算机系统上默认的时间.
- 较短的列表可用于 TimeObject[{h,m,s}] 中,表示指定的时间准确度:{h} 不视为与 {h,0,0} 等价.
- TimeObject[n] 给出一个表示从午夜开始 n 小时的对象,相当于 TimeObject[{n}].
- TimeObject[rtime,gran] 表示相对于参考时间 rtime 的时间 gran 的粒度元素. 例如,TimeObject[{10,4},"Minute"] 表示对应于 10:04 am 的分钟.
- 在 TimeObject[rtime,gran] 中,粒度 gran 可以如下:
-
"Hour" 参考时间的小时 "Minute" 参考时间的分钟 "Second" 参考时间的秒 "Decisecond" 精确到 0.1 秒的时刻 "Centisecond" 精确到 0.01 秒的时刻 "Millisecond" 精确到 0.001 秒的时刻 "Microsecond" 精确到 10^-6 秒的时刻 "Nanosecond" 精确到 10^-9 秒的时刻 "Instant" 精确的指定时间 - TimeObject[rdate,n],其中 n 为非负 Integer,表示精确到 10-n 秒的日期(如:TimeObject[rdate, 6] 对应于 10-6 秒的精确度,与 TimeObject[rdate,"Microsecond"] 一样).
- 在 TimeObject[rdate,n] 中,n 可取的最大值为 9.
- TimeObject 允许进行时间量的相加和相减.
- 两个 TimeObject 结构体相减给出时间量.
- 可以给出下列选项:
-
DateGranularity Automatic 使用的粒度 TimeZone None 使用的时区 - TimeZone 指定应为距 GMT 的偏移数值,时区字符串或 None.
- TimeObject 的 Information 可能包括以下属性:
-
"Time" 指定时间的字符串格式 "Granularity" 时间颗粒 "TimeZone" 时区
范例
打开所有单元关闭所有单元基本范例 (2)常见实例总结
In[1]:=1

✖
https://wolfram.com/xid/0e7n20j2-ftt9v3
Out[1]=1

In[1]:=1

✖
https://wolfram.com/xid/0e7n20j2-s9el1u
Out[1]=1

In[3]:=3

✖
https://wolfram.com/xid/0e7n20j2-pvxf4y
Out[3]=3

In[1]:=1

✖
https://wolfram.com/xid/0e7n20j2-0qaby4
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0e7n20j2-6g0a8e
Out[2]=2

选项 (2)各选项的常用值和功能
DateGranularity (1)
In[1]:=1

✖
https://wolfram.com/xid/0e7n20j2-44lro2
Out[1]=1

用 DateGranularity"Hour" 生成一个小时:
In[4]:=4

✖
https://wolfram.com/xid/0e7n20j2-3zi4bv
Out[5]=5

属性和关系 (1)函数的属性及与其他函数的关联
In[1]:=1

✖
https://wolfram.com/xid/0e7n20j2-c4rrtz
Out[1]=1

In[1]:=1

✖
https://wolfram.com/xid/0e7n20j2-md1kyl
Out[1]=1

具有不等精度和交叉时间段的时间对象的比较将以未计算形式返回:
In[3]:=3

✖
https://wolfram.com/xid/0e7n20j2-dqpb0e

Out[3]=3

In[4]:=4

✖
https://wolfram.com/xid/0e7n20j2-7l48wx
Out[4]=4

In[5]:=5

✖
https://wolfram.com/xid/0e7n20j2-opcpg6
Out[5]=5

Wolfram Research (2014),TimeObject,Wolfram 语言函数,https://reference.wolfram.com/language/ref/TimeObject.html (更新于 2024 年).
✖
Wolfram Research (2014),TimeObject,Wolfram 语言函数,https://reference.wolfram.com/language/ref/TimeObject.html (更新于 2024 年).
文本
Wolfram Research (2014),TimeObject,Wolfram 语言函数,https://reference.wolfram.com/language/ref/TimeObject.html (更新于 2024 年).
✖
Wolfram Research (2014),TimeObject,Wolfram 语言函数,https://reference.wolfram.com/language/ref/TimeObject.html (更新于 2024 年).
CMS
Wolfram 语言. 2014. "TimeObject." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2024. https://reference.wolfram.com/language/ref/TimeObject.html.
✖
Wolfram 语言. 2014. "TimeObject." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2024. https://reference.wolfram.com/language/ref/TimeObject.html.
APA
Wolfram 语言. (2014). TimeObject. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/TimeObject.html 年
✖
Wolfram 语言. (2014). TimeObject. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/TimeObject.html 年
BibTeX
✖
@misc{reference.wolfram_2025_timeobject, author="Wolfram Research", title="{TimeObject}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/TimeObject.html}", note=[Accessed: 06-April-2025
]}
BibLaTeX
✖
@online{reference.wolfram_2025_timeobject, organization={Wolfram Research}, title={TimeObject}, year={2024}, url={https://reference.wolfram.com/language/ref/TimeObject.html}, note=[Accessed: 06-April-2025
]}