title: How create utctime query from model on yesod?
body: <p>Hi everyone my question is about how can I create a query on Yesod from my database for get only the instance which satisfy the condition by UTCtime.</p>
  
  <p>My model is this:</p>
  
  <pre><code>Post
      name Text
      content Text
      date UTCTime default=CURRENT_TIME
      deriving Show
  </code></pre>
  
  <p>And I want a query which I can extract only the post which satisfy a date whit the year 2014, for example. I suppose my handler for the query must look something similar like this:</p>
  
  <pre><code>getYearR :: Integer -&gt; Handler Html
  getYearR year = do
      posts &lt;- runDB $ selectList [*With some code here about the date and year*] [Desc PostDate]
      defaultLayout $ do
          aDomId &lt;- newIdent
          setTitle "Blog"
          $(widgetFile "homepage")
  </code></pre>
  
  <p>Maybe the solution is create a raw sql query, but I think that is not a right solution.</p>
  
  <p>Thanks for your time and I really appreciate your help</p>