Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Convert a number representing seconds to a quantity of time in an appropriate unit
Convert a number of seconds into a Quantity object:
| In[1]:= |
| Out[1]= |
Convert a Quantity object representing time into an easier-to-read unit:
| In[2]:= |
| Out[2]= |
| In[3]:= |
| Out[3]= |
For symbolic values, the result is just a Quantity of seconds:
| In[4]:= |
| Out[4]= |
| In[5]:= |
| Out[5]= |
Convert an approximate value represented as an Around object:
| In[6]:= |
| Out[6]= |
Convert a range of values represented by an Interval object:
| In[7]:= |
| Out[7]= |
By default, SecondsToQuantity can return MixedUnit in the output:
| In[8]:= |
| Out[8]= |
Get non-mixed units instead:
| In[9]:= |
| Out[9]= |
By default, the number of units used in MixedUnit outputs is limited:
| In[10]:= |
| Out[10]= |
Restrict to a maximum of two units:
| In[11]:= |
| Out[11]= |
Show all available mixed units:
| In[12]:= |
| Out[12]= |
| In[13]:= |
| Out[13]= |
Using "MaxMixedUnits"→1 is effectively equivalent to "MixedUnits"→False:
| In[14]:= |
| Out[14]= |
| In[15]:= |
| Out[15]= |
Improve the readability of the output for functions that return time as a number of seconds:
| In[16]:= |
| Out[16]= |
| In[17]:= |
| Out[17]= |
| In[18]:= |
| Out[18]= |
| In[19]:= |
| Out[19]= |
Convert the number of seconds since January 1, 1970, in the GMT time zone to more readable units:
| In[20]:= |
| Out[19]= |
The resource function RelativeTimeString uses SecondsToQuantity to convert units:
| In[21]:= |
| Out[21]= | ![]() |
| In[22]:= | ![]() |
| Out[22]= | ![]() |
MixedUnit values are not used for values that are very large or very small:
| In[23]:= |
| Out[23]= |
| In[24]:= |
| Out[24]= |
With the default setting of "MaxMixedUnits"→Automatic, mixed units are not used for Interval or Around objects:
| In[25]:= |
| Out[25]= |
| In[26]:= |
| Out[26]= |
Specify a positive value to override the default behavior:
| In[27]:= |
| Out[27]= |
| In[28]:= |
| Out[28]= |
Units must be compatible:
| In[29]:= |
| Out[29]= |
This work is licensed under a Creative Commons Attribution 4.0 International License