posixDateTask : Task.Task x Time.Date.Date
posixDateTask =
let
timeZoneDate now =
Time.Date.date
(Time.ZonedDateTime.year (Time.ZonedDateTime.fromDateTime (TimeZones.canada_pacific ()) now))
(Time.ZonedDateTime.month (Time.ZonedDateTime.fromDateTime (TimeZones.canada_pacific ()) now))
(Time.ZonedDateTime.day (Time.ZonedDateTime.fromDateTime (TimeZones.canada_pacific ()) now))
in
Time.now
|> Task.map timeZoneDate
这给我一个错误:
|> Task.map timeZoneDate
(|>) is expecting the right side to be a:
Task.Task x Time.Time -> a
But the right side is:
Task.Task x Time.DateTime.DateTime -> Task.Task x Time.Date.Date
我应该如何更改以返回Task.Task x Time.Date.Date
类型。我不知道Time.DateTime.DateTime
的来源。
Time.DateTime.fromTimestamp