私はHaskellで、日時であるByteStringを取得し、元のエンコーディングのタイムゾーンを考慮してUTC時間に変換する関数を作成しようとしています。私はHaskellを初めて使用するので、本当に基本的な間違いを犯している可能性があります。
convertStringToUtc s =
do
estTimeZone <- hoursToTimeZone -5
time <- read $ B.unpack(s)
localTimeToUTC estTimeZone time
私が得るエラーは次のとおりです。
Couldn't match expected type `Int -> b'
against inferred type `UTCTime'
In the expression: localTimeToUTC estTimeZone time
In the expression:
do { estTimeZone <- hoursToTimeZone - 5;
time <- read $ B.unpack (s);
localTimeToUTC estTimeZone time }