Skip to content

Commit

Permalink
backend/refactor/local_time
Browse files Browse the repository at this point in the history
  • Loading branch information
Utkarsh Pandey1 authored and hkmangla committed Jun 27, 2023
1 parent aadcf1d commit 5a1f39a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/mobility-core/src/Kernel/Utils/Time.hs
Original file line number Diff line number Diff line change
@@ -22,8 +22,8 @@ module Kernel.Utils.Time
where

import qualified Data.Text as T
import Data.Time hiding (getCurrentTime, nominalDiffTimeToSeconds)
import qualified Data.Time as Time
import Data.Time hiding (getCurrentTime, nominalDiffTimeToSeconds, secondsToNominalDiffTime)
import qualified Data.Time as Time hiding (secondsToNominalDiffTime)
import EulerHS.Prelude
import Kernel.Types.Time
import Kernel.Utils.Logging
@@ -35,6 +35,9 @@ isExpired nominal time = do
let addedUTCTime = addUTCTime nominal time
return $ now > addedUTCTime

getLocalCurrentTime :: MonadTime m => Seconds -> m UTCTime
getLocalCurrentTime timeDiff = addUTCTime (secondsToNominalDiffTime timeDiff) <$> getCurrentTime

-- | Format time in IST and return it as text
-- Converts and Formats in the format
-- TODO: make a generic function and then pass format

0 comments on commit 5a1f39a

Please sign in to comment.