How do I get the current time in Elm?

后端 未结 8 1335
庸人自扰
庸人自扰 2020-12-03 01:15

I\'m running elm-repl to play around with the language.

I\'d like to see what the current time is. How would I do that? It doesn\'t appear to be possible with the c

8条回答
  •  失恋的感觉
    2020-12-03 01:57

    You can see pdoherty926's answer for how to do something with the current time in Elm.

    elm-repl doesn't have the ability to work with Signals, and time "changes over time" so it's a signal. There also isn't a Task for getting the time, that I know of. Nor a way to execute tasks in the repl, though I expect that will be feature in the future.

提交回复
热议问题