Skip to content

Instantly share code, notes, and snippets.

@broskees
Created January 7, 2022 23:42
Show Gist options
  • Save broskees/14881503fcbc0af5d388641b3e3bda83 to your computer and use it in GitHub Desktop.
Save broskees/14881503fcbc0af5d388641b3e3bda83 to your computer and use it in GitHub Desktop.
Readwise to obsidian template - zettlekasten 12 digit id (based on date & time) (Jinja)
{{date|date("Ymd")}}{% for char in time|replace(":", "")|replace("am", "")|replace("pm", "")|list %}{% if loop.index == 1 and time[1] == ":" and "am" in time %}0{{char}}{% elif loop.index < 3 and time[2] == ":" and time[1] == "2" and "am" in time %}0{% elif loop.index == 1 and time[1] == ":" and "pm" in time %}{{char|int() + 12}}{% elif loop.index < 3 and time[2] == ":" and "pm" in time %}{{char|int() + loop.index}}{% else %}{{char}}{% endif %}{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment