TimeObject
✖
TimeObject

gives the time object of granularity gran that includes the reference time rtime.
Details and Options


- TimeObject[] uses whatever time has been set on your computer system by default.
- Shorter lists can be used in TimeObject[{h,m,s}], which represents the time to whatever accuracy is specified: {h} is not treated as being equivalent to {h,0,0}.
- TimeObject[n] gives an object representing n hours from midnight and is equivalent to TimeObject[{n}].
- TimeObject[rtime,gran] represents a granular element of time gran for the reference time rtime. For example, TimeObject[{10,4},"Minute"] represents the minute corresponding to 10:04 am.
- In TimeObject[rtime,gran], the granularity gran can be any of the following:
-
"Hour" hour of the reference time "Minute" minute of the reference time "Second" second of the reference time "Decisecond" moment accurate to 0.1 seconds "Centisecond" moment accurate to 0.01 seconds "Millisecond" moment accurate to 0.001 seconds "Microsecond" moment accurate to 10^-6 seconds "Nanosecond" moment accurate to 10^-9 seconds "Instant" the exact specified time - TimeObject[rdate,n] where n is a non-negative Integer represents a date accurate to 10-n seconds (e.g. TimeObject[rdate, 6] corresponds to 10-6 seconds accuracy, the same as TimeObject[rdate,"Microsecond"]).
- The maximum available value for n in TimeObject[rdate,n] is 9.
- TimeObject allows addition and subtraction of time quantities.
- Subtracting two TimeObject constructs yields a time quantity.
- The following options can be given:
-
DateGranularity Automatic granularity being used TimeZone None time zone being used - TimeZone specifications should be a numerical offset from GMT, a time zone string or None.
- Information of a TimeObject may include the following properties:
-
"Time" string form of the specified time "Granularity" time granularity "TimeZone" time zone
Examples
open allclose allBasic Examples (2)Summary of the most common use cases

https://wolfram.com/xid/0e7n20j2-jm76uc


https://wolfram.com/xid/0e7n20j2-wuti3j

Represent 15 seconds past 8:04pm:

https://wolfram.com/xid/0e7n20j2-egbmqb

Add 13 hours to a time object:

https://wolfram.com/xid/0e7n20j2-uc62ks

Subtracting time objects gives a time quantity:

https://wolfram.com/xid/0e7n20j2-w3jppf

Scope (1)Survey of the scope of standard use cases
Options (2)Common values & functionality for each option
DateGranularity (1)
By default, dates are generated with "Instant" granularity:

https://wolfram.com/xid/0e7n20j2-6z61y0

Use DateGranularity"Hour" to generate an hour:

https://wolfram.com/xid/0e7n20j2-zi2tqw

Properties & Relations (1)Properties of the function, and connections to other functions
Compare time objects to determine their sequence of occurrence:

https://wolfram.com/xid/0e7n20j2-c4rrtz


https://wolfram.com/xid/0e7n20j2-s1zzl9

Comparisons of time objects with unequal precision and overlapping time periods will return unevaluated:

https://wolfram.com/xid/0e7n20j2-c61n4d



https://wolfram.com/xid/0e7n20j2-7l48wx


https://wolfram.com/xid/0e7n20j2-opcpg6

Wolfram Research (2014), TimeObject, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeObject.html (updated 2024).
Text
Wolfram Research (2014), TimeObject, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeObject.html (updated 2024).
Wolfram Research (2014), TimeObject, Wolfram Language function, https://reference.wolfram.com/language/ref/TimeObject.html (updated 2024).
CMS
Wolfram Language. 2014. "TimeObject." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/TimeObject.html.
Wolfram Language. 2014. "TimeObject." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/TimeObject.html.
APA
Wolfram Language. (2014). TimeObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TimeObject.html
Wolfram Language. (2014). TimeObject. Wolfram Language & System Documentation Center. Retrieved from 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: 25-March-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: 25-March-2025
]}