Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Convert raw seconds into a human-readable amount of time
| ResourceFunction["ReadableTimeString"][seconds] converts seconds into a human-readable time string. | 
| "Decimals" | Automatic | the number of decimal places after the decimal point | 
| NumberPoint | "." | the decimal point character, e.g. in South Africa you might use a comma | 
| "PrefixShort" | True | use short prefixes instead of long, e.g. "m" for "mega" | 
| "ReturnQuantity" | False | whether to return a Quantity object instead of a string | 
| "Spacer" | " " | string that goes in between the number and unit | 
| millisecond | "ms" | 
| second | "s" | 
| minute | "m" | 
| hour | "h" | 
| day | "d" | 
| week | "w" | 
| month | "M" | 
| year | "Y" | 
Convert seconds into a human-readable amount:
| In[1]:= | ![ResourceFunction["ReadableTimeString"][18000]](https://www.wolframcloud.com/obj/resourcesystem/images/acb/acb281db-dd96-4940-81d3-6ca3e9dd653b/7ad30214a02d728f.png) | 
| Out[1]= |  | 
ReadableTimeString works on many time scales:
| In[2]:= | ![ResourceFunction["ReadableTimeString"] /@ PowerRange[100000000]](https://www.wolframcloud.com/obj/resourcesystem/images/acb/acb281db-dd96-4940-81d3-6ca3e9dd653b/1ff97ab429394b49.png) | 
| Out[2]= |  | 
Return a rounded amount:
| In[3]:= | ![ResourceFunction["ReadableTimeString"][61, "Decimals" -> 2]](https://www.wolframcloud.com/obj/resourcesystem/images/acb/acb281db-dd96-4940-81d3-6ca3e9dd653b/50066e5c0f760416.png) | 
| Out[3]= |  | 
| In[4]:= | ![ResourceFunction["ReadableTimeString"][13274, "PrefixShort" -> False]](https://www.wolframcloud.com/obj/resourcesystem/images/acb/acb281db-dd96-4940-81d3-6ca3e9dd653b/5019c34c6a7947d3.png) | 
| Out[4]= |  | 
| In[6]:= | ![ResourceFunction["ReadableTimeString"][13274, "Spacer" -> ""]](https://www.wolframcloud.com/obj/resourcesystem/images/acb/acb281db-dd96-4940-81d3-6ca3e9dd653b/177437800e7c107e.png) | 
| Out[6]= |  | 
This work is licensed under a Creative Commons Attribution 4.0 International License