diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2012–2019 Roel van Dijk
+Copyright 2012–2023 Roel van Dijk and project contributors
 
 All rights reserved.
 
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,7 @@
+### 0.4.2
+
+* Fixed divide by zero error in remainingTime label (thanks to daniel-chambers).
+
 ### 0.4.1
 
 * Added styleOnComplete field to Style record. Defaults to
diff --git a/src/System/ProgressBar.hs b/src/System/ProgressBar.hs
--- a/src/System/ProgressBar.hs
+++ b/src/System/ProgressBar.hs
@@ -568,8 +568,8 @@
 remainingTime formatNDT altMsg = Label render
   where
     render progress timing
-        | dt > 1 = formatNDT estimatedRemainingTime
         | progressDone progress <= 0 = altMsg
+        | dt > 1 = formatNDT estimatedRemainingTime
         | otherwise = altMsg
       where
         estimatedRemainingTime = estimatedTotalTime - dt
diff --git a/terminal-progress-bar.cabal b/terminal-progress-bar.cabal
--- a/terminal-progress-bar.cabal
+++ b/terminal-progress-bar.cabal
@@ -1,5 +1,5 @@
 name:          terminal-progress-bar
-version:       0.4.1
+version:       0.4.2
 cabal-version: >=1.10
 build-type:    Simple
 author:        Roel van Dijk <roel@lambdacube.nl>
diff --git a/test/test.hs b/test/test.hs
--- a/test/test.hs
+++ b/test/test.hs
@@ -9,13 +9,14 @@
 
 import "base" System.Environment ( getArgs )
 import "base" Data.Semigroup ( (<>) )
+import "base" Data.Fixed (Pico)
 import "HUnit" Test.HUnit.Base ( assertEqual )
 import "test-framework" Test.Framework
     ( defaultMainWithOpts, interpretArgsOrExit, Test, testGroup )
 import "test-framework-hunit" Test.Framework.Providers.HUnit ( testCase )
 import "terminal-progress-bar" System.ProgressBar
 import qualified "text" Data.Text.Lazy as TL
-import "time" Data.Time.Clock ( UTCTime(..), NominalDiffTime )
+import "time" Data.Time (UTCTime(..), NominalDiffTime, formatTime, defaultTimeLocale, addUTCTime, secondsToNominalDiffTime)
 
 --------------------------------------------------------------------------------
 -- Test suite
@@ -62,12 +63,22 @@
                (exact <> msg " - " <> percentage)
                mempty 20 $ Progress 1 2 ()
       ]
-    , testGroup "rendeRuration"
+    , testGroup "renderDuration"
       [ renderDurationTest 42 "42"
       , renderDurationTest (5 * 60 + 42) "05:42"
       , renderDurationTest (8 * 60 * 60 + 5 * 60 + 42) "08:05:42"
       , renderDurationTest (123 * 60 * 60 + 59 * 60 + 59) "123:59:59"
       ]
+    , testGroup "remainingTime"
+      [ labelTestWithTiming "No progress after no time" remainingTimeLabel (Progress 0 100 ()) (elapsedSecsTiming 0) "Estimating"
+      , labelTestWithTiming "No progress after some time" remainingTimeLabel (Progress 0 100 ()) (elapsedSecsTiming 10) "Estimating"
+      , labelTestWithTiming "Some progress after no time" remainingTimeLabel (Progress 50 100 ()) (elapsedSecsTiming 0) "Estimating"
+      , labelTestWithTiming "Some progress after some time" remainingTimeLabel (Progress 50 100 ()) (elapsedSecsTiming 10) "10"
+      , labelTestWithTiming "No work to be done after no time" remainingTimeLabel (Progress 0 0 ()) (elapsedSecsTiming 0) "Estimating"
+      , labelTestWithTiming "No work to be done after some time" remainingTimeLabel (Progress 0 0 ()) (elapsedSecsTiming 10) "Estimating"
+      , labelTestWithTiming "More progress than work to be done after no time" remainingTimeLabel (Progress 50 0 ()) (elapsedSecsTiming 0) "Estimating"
+      , labelTestWithTiming "More progress than work to be done after some time" remainingTimeLabel (Progress 50 0 ()) (elapsedSecsTiming 10) "0"
+      ]
     ]
   ]
 
@@ -75,6 +86,10 @@
 labelTest testName label progress expected =
     testCase testName $ assertEqual expectationError expected $ runLabel label progress someTiming
 
+labelTestWithTiming :: String -> Label () -> Progress () -> Timing -> TL.Text -> Test
+labelTestWithTiming testName label progress timing expected =
+    testCase testName $ assertEqual expectationError expected $ runLabel label progress timing
+
 renderDurationTest :: NominalDiffTime -> TL.Text -> Test
 renderDurationTest dt expected =
     testCase ("renderDuration " <> show dt) $ assertEqual expectationError expected $ renderDuration dt
@@ -98,5 +113,11 @@
 someTiming :: Timing
 someTiming = Timing someTime someTime
 
+elapsedSecsTiming :: Pico -> Timing
+elapsedSecsTiming seconds = Timing someTime (addUTCTime (secondsToNominalDiffTime seconds) someTime)
+
 expectationError :: String
 expectationError = "Expected result doesn't match actual result"
+
+remainingTimeLabel :: Label ()
+remainingTimeLabel = remainingTime (TL.pack . formatTime defaultTimeLocale "%s") "Estimating"
