aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--post/post.go2
-rw-r--r--render/render.go3
-rw-r--r--vlog/vlog.go4
3 files changed, 5 insertions, 4 deletions
diff --git a/post/post.go b/post/post.go
index 9561e46..5634340 100644
--- a/post/post.go
+++ b/post/post.go
@@ -137,7 +137,7 @@ func (p *Post) parse() {
vlog.Printf("no date field in post %s, using file modification time\n", p.SourceFile)
} else {
var err error
- p.Time, err = time.Parse("2006-1-2", date_str)
+ p.Time, err = time.ParseInLocation("2006-1-2", date_str, time.Local)
if err != nil {
// fallback is to use file modtime
// should use create time but that doesn't seem to be in stdlib
diff --git a/render/render.go b/render/render.go
index fa768ca..1606305 100644
--- a/render/render.go
+++ b/render/render.go
@@ -5,6 +5,7 @@ import (
"adammathes.com/snkt/config"
"io/ioutil"
"log"
+ "adammathes.com/snkt/vlog"
"os"
"path"
"path/filepath"
@@ -28,7 +29,7 @@ type Renderable interface {
func Write(a Renderable) {
if config.Config.Verbose {
- log.Printf("Writing to %s\n", a.Target())
+ vlog.Printf("Writing to %s\n", a.Target())
}
os.MkdirAll(path.Dir(a.Target()), 0755)
err := ioutil.WriteFile(a.Target(), a.Render(), 0755)
diff --git a/vlog/vlog.go b/vlog/vlog.go
index ea9e621..abc1db9 100644
--- a/vlog/vlog.go
+++ b/vlog/vlog.go
@@ -3,12 +3,12 @@ package vlog
import (
"adammathes.com/snkt/config"
- "log"
+ "fmt"
)
func Printf(format string, v ...interface{}) {
if config.Config.Verbose {
- log.Printf(format, v...)
+ fmt.Printf(format, v...)
}
}