Time to Decimal

Time to Decimal

Published
February 3, 2025
Author

Beli Löw

Lecture
3 min
Status
Published
Meta Preview
Preview-URL

← All Articles

image

Data migration can be overwhelming, especially when you have many migrations to handle. That's why our formulas master and I have created a huge library of formulas to make the process easier. I wanted to share one of these formulas with you (cause sharing is caring) which is awesome for converting between time and decimal formats.

What is it about

In this article we’re going to share with you our three different formulas, they are quite simple to implement (you will only need to copy and paste, kinda)

1. From Hours (text property) and minutes (hh:mm) to Decimal

This formula converts time from hours and minutes format in a Text Property (like "2:30") into decimal hours (like "2.5"). For example, 1 hour and 30 minutes (1:30) would become 1.50 in decimal format.

This is the formula for you to copy, but there are some other steps to make it fit you database.

lets(
	minuten,
	prop("Time (hh:mm)").replaceAll("\d*:"),
	minutenDezimal,
	minuten.toNumber()/60,
	stunden,
	prop("Time (hh:mm)").replaceAll(":\d*"),
	stundenDezimal,
	stunden.toNumber(),
	round((stundenDezimal+minutenDezimal)*100)/100
)
icon
This is how it works
  1. Create your database and add a text property
  2. Add a formula property
  3. Go to edit property and click on edit formula
  4. Copy the formula you have above.
  5. Edit the formula by adding the property you would like to convert, for example if the name of your property is Time (hours:minutes) in the formula you’ll change ("Time (hh:mm)") to (”Time (hours:minutes)”)
  6. image

2. From Decimal (text property) to Hours and Minutes (hh:mm)

This formula converts decimal time from a text property (like "2.5") back into hours and minutes format (like "2:30"). For example, if you have 1.75 hours in decimal format, it will convert it to 1:45 in time format.

lets(
	minuten,
	prop("Time (h.m)").replaceAll("\d*\.","0."),
	minutenDezimal,
	round(minuten.toNumber()*0.6*100),
	minuteZweistellig,
	ifs(minutenDezimal<10,"0"+minutenDezimal,minutenDezimal),
	stunden,
	prop("Time (h.m)").replaceAll("\.\d*"),
	stundenDezimal,
	stunden.toNumber(),
	stundenDezimal+":"+minuteZweistellig
)
icon
This is how it works

The steps are the same as above, but we made a lil tutorial for you to follow along 😌

image

3. From Decimal (number property) to Hours and Minutes (hh:mm)

This formula converts decimal numbers (like 2.5) from a number property into time format (hours:minutes). For example, if you have 2.5 in your number property, the formula will convert it to "2:30". This is particularly useful when you need to display decimal hours in a more readable time format.

This is our final gift to help you level up your Notion databases and make your data migration simpler.

lets(
	minuten,
	🟱 Decimal (number)-🟱 Decimal (number).floor(),
	minutenDezimal,
	round(minuten*0.6*100),
	minuteZweistellig,
	ifs(minutenDezimal<10,"0"+minutenDezimal,minutenDezimal),
	stunden,
	🟱 Decimal (number).floor(),
	stundenDezimal,
	stunden.toNumber(),
	
	stunden+":"+minuteZweistellig
)
icon
This is how it works

By following this gifs you will notice itÂżs pretty simple, just remember to change the property you want to apply the formula to.

image
icon
Notioneers Tip: Follow along our Insight for more tips and tricks to help you mae the best out of your Notion workspace.
icon

FAQ

‣
What formulas are available for time conversion in Notion?
‣
Do I need to modify the formulas?
‣
What property types do I need for these conversions?
‣
Can I use these formulas with any time format?
icon
image

Beli Löw

Beli is an IT project manager, tool enthusiast, entrepreneur and has organized his whole life with Notion. His news sources are release notes from tools. There is (almost) no feature or shortcut that he does not know.

image

Join us Today: and become a Notion know-all

Wouldn’t you like to know more?

Keep Reading