mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
fix: time zone info is now shown
datetime.now() produces a naive datetime object which does not know tzinfo. So the '%z' has no effect. We need to convert it to time zone aware object using `datetime.astimezone()`.
This commit is contained in:
parent
ec6349fb3f
commit
70f02ae20f
@ -20,7 +20,7 @@ snippet "meta(data)?" "Markdown front matter in YAML format" br
|
||||
title: "$1"
|
||||
date: `!p from datetime import datetime
|
||||
if not snip.c:
|
||||
snip.rv=datetime.now().strftime("%Y-%m-%d %H:%M:%S%z")`
|
||||
snip.rv=datetime.now().astimezone().strftime("%Y-%m-%d %H:%M:%S%z")`
|
||||
tags: [$2]
|
||||
categories: [$3]
|
||||
---
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user