old_contents: #!/bin/env python
  import os
  import sys
  import datetime
  
  import datetime
  import jinja2
  
  DEFAULT_POSTS_PATH = './_posts'
  POST_TEMPLATE = 'post.template'
  
  
  def get_title():
      try:
          return sys.argv[1]
      except IndexError:
          raise RuntimeError("You need to add the title as a parameter")
  
  
  def format_title(title):
      return title.lower().replace(" ", "-")
  
  
  def get_file_path(formatted_title):
      today = str(datetime.date.today())
      return os.path.join(DEFAULT_POSTS_PATH,
                          today + '-' + formatted_title + ".markdown")
  
  
  def get_current_day():
      current_day = datetime.datetime.now()
      return str(current_day.date()) + current_day.strftime(" %X %z")
  
  
  def get_rendered_content(title):
      path = os.path.dirname(os.path.abspath(__file__))
      template_environment = jinja2.Environment(
          autoescape=False,
          loader=jinja2.FileSystemLoader(os.path.join(path, 'templates')),
          trim_blocks=False)
      context = {
          'title': title,
          'current_day': get_current_day(),
          'categories': "kubernetes",
          'image': "/images/cup.jpg"
      }
      return template_environment.get_template(POST_TEMPLATE).render(context)
  
  
  def write_post(content, file_path):
      with open(file_path, 'w+') as post:
          post.write(content)
  
  
  def main():
      title = get_title()
      file_path = get_file_path(format_title(title))
      content = get_rendered_content(title)
      write_post(content, file_path)
      print(file_path)
  
  
  if __name__ == '__main__':
      main()
  
new_contents: #!/bin/env python
  import os
  import sys
  import datetime
  
  import datetime
  import jinja2
  
  DEFAULT_POSTS_PATH = './_posts'
  POST_TEMPLATE = 'post.template'
  
  
  def get_title():
      try:
          return sys.argv[1]
      except IndexError:
          raise RuntimeError("You need to add the title as a parameter")
  
  
  def format_title(title):
      return title.lower().replace(" ", "-")
  
  
  def get_file_path(formatted_title):
      today = str(datetime.date.today())
      return os.path.join(DEFAULT_POSTS_PATH,
                          today + '-' + formatted_title + ".markdown")
  
  
  def get_current_day():
      current_day = datetime.datetime.now(datetime.timezone.utc)
      return str(current_day.date()) + current_day.strftime(" %X %z")
  
  
  def get_rendered_content(title):
      path = os.path.dirname(os.path.abspath(__file__))
      template_environment = jinja2.Environment(
          autoescape=False,
          loader=jinja2.FileSystemLoader(os.path.join(path, 'templates')),
          trim_blocks=False)
      context = {
          'title': title,
          'current_day': get_current_day(),
          'categories': "kubernetes",
          'image': "/images/cup.jpg"
      }
      return template_environment.get_template(POST_TEMPLATE).render(context)
  
  
  def write_post(content, file_path):
      with open(file_path, 'w+') as post:
          post.write(content)
  
  
  def main():
      title = get_title()
      file_path = get_file_path(format_title(title))
      content = get_rendered_content(title)
      write_post(content, file_path)
      print(file_path)
  
  
  if __name__ == '__main__':
      main()
  
subject: Use UTC timezone instead.