robertbasic/vim-hugo-helper

The date format is wrong on some platforms

sangaline opened this issue · 4 comments

The date is autofilled as

date = "2017-03-17T06:46:33-0700"

on my machine while it would need to be

date = "2017-03-17T06:46:33-07:00"

for Hugo to parse it properly. I'm guessing that this is because the underlying strftime call is returning different things on different platforms (it's described as "not portable" in the docs).

Would it be possible to insert the colon if the last four characters are digits? That should allow it to work in both cases.

@sangaline what does date +"%FT%T%:z" print out for you in your terminal?

It includes the colon:

$ date +"%FT%T%:z"
2017-03-26T03:15:15-07:00

Cool, thanks!

Thanks for the report @sangaline!