Skip to content

Commit

Permalink
Merge pull request #20 from imclerran/example-improvements
Browse files Browse the repository at this point in the history
Refactor example to use a clearer logic flow
  • Loading branch information
imclerran authored Apr 30, 2024
2 parents 791dafb + a04db37 commit 2328ae5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/Example.roc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ app "example1"
provides [main] to pf

main =
utcNow <- Utc.now |> Task.await
dtNow = Utc.toNanosSinceEpoch utcNow |> DateTime.fromNanosSinceEpoch
Stdout.line "Hello, World! The current Zulu time is: $(DateTime.toIsoStr dtNow)"
utcNow = Utc.now!
nowStr = utcNow
|> Utc.toNanosSinceEpoch
|> DateTime.fromNanosSinceEpoch
|> DateTime.toIsoStr
Stdout.line "Hello, World! The current Zulu time is: $(nowStr)"

0 comments on commit 2328ae5

Please sign in to comment.