import (
        "path/filepath"
+       "time"
        "strings"
        "testing"
        "html/template"
 
 Content of the file goes Here
 `
-
+var SIMPLE_PAGE_RFC3339_DATE = "---\ntitle: RFC3339 Date\ndate: \"2013-05-17T16:59:30Z\"\n---\nrfc3339 content"
 var SIMPLE_PAGE_JSON_MULTIPLE = `
 {
        "title": "foobar",
        }
 }
 
+func checkPageDate(t *testing.T, page *Page, time time.Time) {
+       if page.Date != time {
+               t.Fatalf("Page date is: %s.  Expected: %s", page.Date, time)
+       }
+}
+
 func TestCreateNewPage(t *testing.T) {
        p, err := ReadFrom(strings.NewReader(SIMPLE_PAGE), "simple")
        if err != nil {
        checkPageLayout(t, p, "page/single.html")
 }
 
+func TestPageWithDate(t *testing.T) {
+       p, err := ReadFrom(strings.NewReader(SIMPLE_PAGE_RFC3339_DATE), "simple")
+       if err != nil {
+               t.Fatalf("Unable to create a page with frontmatter and body content: %s", err)
+       }
+       d, err := time.Parse(time.RFC3339, "2013-05-17T16:59:30Z")
+       if err != nil {
+               t.Fatalf("Unable to prase page.")
+       }
+       checkPageDate(t, p, d)
+}
+
 func TestCreatePage(t *testing.T) {
        var tests = []struct {
                r string
 
 var TEMPLATE_MISSING_FUNC = "{{ .Title | funcdoesnotexists }}"
 var TEMPLATE_FUNC = "{{ .Title | urlize }}"
 var TEMPLATE_CONTENT = "{{ .Content }}"
+var TEMPLATE_DATE = "{{ .Date }}"
+var INVALID_TEMPLATE_FORMAT_DATE = "{{ .Date.Format time.RFC3339 }}"
 
 var PAGE_URL_SPECIFIED = `---
 title: simple template
                {PAGE_SIMPLE_TITLE, TEMPLATE_TITLE, "simple template"},
                {PAGE_SIMPLE_TITLE, TEMPLATE_FUNC, "simple-template"},
                {PAGE_WITH_MD, TEMPLATE_CONTENT, "<h1>heading 1</h1>\n\n<p>text</p>\n\n<h2>heading 2</h2>\n\n<p>more text</p>\n"},
+               {SIMPLE_PAGE_RFC3339_DATE, TEMPLATE_DATE, "2013-05-17 16:59:30 +0000 UTC"},
        }
 
        s := new(Site)
                }
 
                if string(html.Bytes()) != test.expected {
-                       t.Errorf("Content does not match.  Expected\n\t'%q'\ngot\n\t'%q'", test.expected, html)
+                       t.Errorf("Content does not match.\nExpected\n\t'%q'\ngot\n\t'%q'", test.expected, html)
                }
        }
 }