Permalink
Browse files

Update 'new_post' task to use UTC offset for time zone

  • Loading branch information...
1 parent 9491f04 commit bdfee70b5381136ec5e57c0ad1ad7466c253821c @stomar stomar committed Feb 16, 2014
Showing with 5 additions and 3 deletions.
  1. +5 −3 Rakefile
View
@@ -40,8 +40,10 @@ namespace :new_post do
url_title = 'short-title'
title = 'Post Title'
- creation_time = Time.now.utc
- filename = creation_time.strftime("%Y-%m-%d-#{url_title}.md")
+ now = Time.now.utc
+ datetime = now.strftime("%Y-%m-%d %H:%M:%S %z")
+ date = now.strftime("%Y-%m-%d")
+ filename = "#{date}-#{url_title}.md"
path = File.join(lang, 'news', '_posts', filename)
content = <<-TEMPLATE.gsub(/^ */, '')
@@ -50,7 +52,7 @@ namespace :new_post do
title: "#{title}"
author: "Unknown Author"
translator:
- date: #{creation_time}
+ date: #{datetime}
lang: #{lang}
---

0 comments on commit bdfee70

Please sign in to comment.