TISKBAF
  • 🖥️Linux OS
    • Useful Linux commands
    • To get a list of the dependencies of a package
    • Reset a Forgotten Root Password
    • How to Kill a Port in Linux
    • How to Install/Reinstall Linux GRUB Menu
    • Concatenate mp4 files using FFmpeg
    • Command to stop mirroring screens
    • Command to Run when Trash Won’t Empty
    • Prey Configuration Command (via Terminal)
    • Prey Configuration Command (via Terminal)
  • 🖥️Windows OS
    • Custom Profile Badges
      • badge-maker
      • shields.io - static badges
    • How to kill a task via terminal on Windows
    • Find and terminate a Windows Process by Port
    • The Complete List of Command Prompt (CMD) Commands
    • youtube-dl Usage
    • WSA/Google Play Services Reference Information
    • Windows Update Blocker (Windows Services Blocker)
    • Windows 11 Shell commands with friendly names
    • Wifi not automatically connecting on start-up when Ethernet is connected
    • To install many APK files at once
    • To get Firefox to remember logged in accounts
    • Spicetify Commands
    • Speech Recognition Commands
    • Simpletask [Simple] Documentation
    • Sideload Apps in Windows Subsystem for Android from APK Files
    • SetUserFTA Utility
    • Screensaver not starting even though it is configured correctly
    • Run Keys Registry Location
    • Rainmeter Config Definitions
    • Pushover
    • Program Folder Locations
    • Add an exclusion to Windows Security (or just turn off real-time protection)
    • Reddit RSS Feeds
    • Portainer on Windows
    • PGP: Encrypt & sign emails in a few clicks
    • Permanently Remove OneDrive from Windows
    • IRC NickServ Commands (full list)
    • Convert a P12/PFX Certificate to a .CER
    • How to embed in HTML
    • Misc. Windows Information
    • Issues with missing icons in Windows
    • Information on ‘scoop’ package manager for Windows
    • DISMTools Docs
    • Creating Python Virtual Environment in Windows and Linux
    • Using XnConvert to bulk convert image sizes
    • How to Merge Multiple Text Files using different methods in Windows
    • How to use OLLAMA_ORIGINS in Windows
    • To permanently turn off Windows Security and Windows Defender1
    • Enabling the disabled sounds in Windows
    • Enable classic right-click context menu on Windows 11
    • How to Convert Kindle Books (.awz/.awz3) to Other E-book Formats
    • How to Create Symbolic Links with mklink
    • APIMyLlama Commands
  • 🏬[Graphic] Design
    • Create a Realistic Shadow for Objects in GIMP (video)
    • How to Add Outer Glow Effects in GIMP
    • How to Curve Text In GIMP
    • Rounded corners in GIMP (video)
    • WORD CLOUD TEXT PORTRAIT EFFECT IN PHOTOSHOP (video)
    • BROKEN 3D TEXT EFFECT | PHOTOSHOP (video)
    • Type on a path in Photoshop
    • Nudify Guide (Stable Diffusion)
  • 💻Coding & Developing
    • APIMyLlama V2
      • APIMyLlama Source: Github
    • Insert Back button on a webpage
    • How to have a web page refresh automatically
    • AstroPaper Blog Theme
      • How to configure AstroPaper theme - Blog
      • Adding new posts in AstroPaper theme
    • How to generate Django SECRET_KEY
  • 📒Everything else
    • RSS Feed in your Notion Pages
    • 12 Firefox Hidden Settings You Should Check Out
    • ADB (almost) Full Commands List
    • How to pair your Wear OS smartwatch with a new phone
    • How to reset Cync by GE smart lights
    • IRC Servers & Channels Info
    • Internxt CLI commands and usage
    • Call Forwarding on mobile device
    • Obsidian Templater plugin
    • Exportify Documentation
    • KLLOQUE K10 B Ball Lock User Manual
    • How to delete bloatware from Android device
Powered by GitBook
On this page
  • Date Module
  • Documentation
  • Moment.js
  • Examples
  1. Everything else

Obsidian Templater plugin

PreviousCall Forwarding on mobile deviceNextExportify Documentation

Last updated 7 months ago

This module contains every internal function related to dates.

Function documentation is using a specific syntax. More information .

Retrieves the date.

  • format: The format for the date. Defaults to "YYYY-MM-DD". Refer to .

  • offset: Duration to offset the date from. If a number is provided, duration will be added to the date in days. You can also specify the offset as a string using the ISO 8601 format.

  • reference: The date referential, e.g. set this to the note's title.

  • reference_format: The format for the reference date. Refer to .

// Date now
<% tp.date.now() %>

// Date now with format
<% tp.date.now("Do MMMM YYYY") %>

// Last week
<% tp.date.now("YYYY-MM-DD", -7) %>

// Next week
<% tp.date.now("YYYY-MM-DD", 7) %>

// Last month
<% tp.date.now("YYYY-MM-DD", "P-1M") %>

// Next year
<% tp.date.now("YYYY-MM-DD", "P1Y") %>

// File's title date + 1 day (tomorrow)
<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>

// File's title date - 1 day (yesterday)
<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %>

Retrieves tomorrow's date.

// Date tomorrow
<% tp.date.tomorrow() %>

// Date tomorrow with format
<% tp.date.tomorrow("Do MMMM YYYY") %>
  • weekday: Week day number. If the locale assigns Monday as the first day of the week, 0 will be Monday, -7 will be last week's day.

  • reference: The date referential, e.g. set this to the note's title.

// This week's Monday
<% tp.date.weekday("YYYY-MM-DD", 0) %>

// Next Monday
<% tp.date.weekday("YYYY-MM-DD", 7) %>

// File's title Monday
<% tp.date.weekday("YYYY-MM-DD", 0, tp.file.title, "YYYY-MM-DD") %>

// File's title previous Monday
<% tp.date.weekday("YYYY-MM-DD", -7, tp.file.title, "YYYY-MM-DD") %>

Retrieves yesterday's date.

// Date yesterday
<% tp.date.yesterday() %>

// Date yesterday with format
<% tp.date.yesterday("Do MMMM YYYY") %>

Templater gives you access to the moment object, with all of its functionalities.

// Date now
<% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>

// Get start of month from note title
<% moment(tp.file.title, "YYYY-MM-DD").startOf("month").format("YYYY-MM-DD") %>

// Get end of month from note title
<% moment(tp.file.title, "YYYY-MM-DD").endOf("month").format("YYYY-MM-DD") %>
// Date now
<% tp.date.now() %>

// Date now with format
<% tp.date.now("Do MMMM YYYY") %>

// Last week
<% tp.date.now("YYYY-MM-DD", -7) %>

// Next week
<% tp.date.now("YYYY-MM-DD", 7) %>

// Last month
<% tp.date.now("YYYY-MM-DD", "P-1M") %>

// Next year
<% tp.date.now("YYYY-MM-DD", "P1Y") %>

// File's title date + 1 day (tomorrow)
<% tp.date.now("YYYY-MM-DD", 1, tp.file.title, "YYYY-MM-DD") %>

// File's title date - 1 day (yesterday)
<% tp.date.now("YYYY-MM-DD", -1, tp.file.title, "YYYY-MM-DD") %>

// Date tomorrow
<% tp.date.tomorrow() %>

// Date tomorrow with format
<% tp.date.tomorrow("Do MMMM YYYY") %>

// This week's Monday
<% tp.date.weekday("YYYY-MM-DD", 0) %>

// Next Monday
<% tp.date.weekday("YYYY-MM-DD", 7) %>

// File's title Monday
<% tp.date.weekday("YYYY-MM-DD", 0, tp.file.title, "YYYY-MM-

format: The format for the date. Defaults to "YYYY-MM-DD". Refer to .

format: The format for the date. Defaults to "YYYY-MM-DD". Refer to .

reference_format: The format for the reference date. Refer to .

format: The format for the date. Defaults to "YYYY-MM-DD". Refer to .

More information on moment.js .

📒
Date Module
Documentation
tp.date.now(format: string = "YYYY-MM-DD", offset?: number⎮string, reference?: string, reference_format?: string)
tp.date.tomorrow(format: string = "YYYY-MM-DD")
tp.date.weekday(format: string = "YYYY-MM-DD", weekday: number, reference?: string, reference_format?: string)
tp.date.yesterday(format: string = "YYYY-MM-DD")
Moment.js
Examples
Documentation
here
tp.date.now(format: string = "YYYY-MM-DD", offset?: number⎮string, reference?: string, reference_format?: string)
Arguments
format reference
format reference
Examples
tp.date.tomorrow(format: string = "YYYY-MM-DD")
Arguments
format reference
Examples
tp.date.weekday(format: string = "YYYY-MM-DD", weekday: number, reference?: string, reference_format?: string)
Arguments
format reference
format reference
Examples
tp.date.yesterday(format: string = "YYYY-MM-DD")
Arguments
format reference
Examples
Moment.js
here
Examples
Examples