title: How do I get the current date in elm?
body: <p>I'm trying to figure out how to get the current date in elm in version .17. I see that they added a Date module to .17 but I haven't found any examples on how it's used. Has anyone figured out how to do this?</p>
  
  <p>Edit: 
  In trying to retrofit this solution, I hit another stumbling block. I'm trying to trigger setting the date and then calling another Msg to do something else. But I'm still getting {} for a date.</p>
  
  <pre><code>import Html.App as App
  import Html exposing (..)
  import Time exposing (Time)
  import Task
  import Date exposing (Date)
  import Html.Events exposing (onClick)
  import Html.Attributes exposing (..)
  
  type alias Model =
    {currentDate : Maybe Date}
  
  type Msg =
    SetDate (Maybe Date)
    | TriggerDateSet
  
  update : Msg -&gt; Model -&gt; (Model, Cmd Msg)
  update msg model =
    case msg of
      SetDate date -&gt;
        ({model | currentDate = date}, Cmd.none)
      TriggerDateSet -&gt;
        (model, now)
  
  view : Model -&gt; Html Msg
  view model =
    div []
    [ div []
      [ button [onClick TriggerDateSet] [] ]
    , div [] [ text &lt;| "(Optional) time at program launch was " ++ toString model ]
    ]
  
  now : Cmd Msg
  now =
    Task.perform (always (SetDate Nothing)) (Just &gt;&gt; SetDate) Date.now
  
  main : Program Never
  main =
    App.program
      { init = ( Model Nothing, now )
      , view = view
      , subscriptions = always Sub.none
      , update = update
      }
  </code></pre>