Logo Text Blaze

  • Docs
  • Community
  • Documentation

    Loading...

    Community Forums

    Loading...
Add to Chrome –  It's Free! Go to Dashboard ›

What's on this Page

  • Inserting today's date
  • Inserting the current time
  • Presenting dates and times in different formats
  • Shifting the date and time
    • Shifting to the beginning or end of a period
  • Setting an anchor date
  • Advanced example
    • Greeting based on the time of day
    • Calculate the date 91 days from a selected date
    • Calculate the date x weekdays from a selected date
    • Calculate someone's age based on their date of birth
    • Calculate the date of a day next week
Guides

Dynamically inserting dates and times

Quick Overview Video

Summary: You can add to your snippet today's date, the current time or any dates and times in the past or future such as tomorrow's date, the time 3 hours ago, the date of the first Monday of next month, and so on.

Inserting today's date

  1. When editing a snippet - click on the date menu
  2. Select the date format you'd like to use
  3. Try the snippet

Here's a sample snippet you can copy over to your dashboard.

Meeting notes with current date
Meeting notes: {time: MMMM Do YYYY}
_

Inserting the current time

  1. When editing a snippet - click on the time menu
  2. Select the time format you'd like to use
  3. Try the snippet

Here's an example:

Meeting notes with current time
{time: h:mm A} - Topic:
_

Presenting dates and times in different formats

You can present the dates and times in different ways. For example, July 4, 1776 at 7:03pm can be shown as (very partial list):

  • Thursday, July 4, 1776
  • 7/4/1776
  • 1776-07-04 at 7pm
  • Thursday
  • 19:03
  • And so on.

To change the way the time is presented:

  1. In the snippet editing window, click on the time or date command you added (the command "pill")
  2. Change the time/date format setting
  3. Try the snippet

Below is a snippet showing the current date and time in different formats:

Different date and time formats
{time: DD/MM/YYYY [at] HH:mm} {time: h:mm a [on] MMM-DD} {time: ddd, MMMM Do, YYYY} {time: [Quarter] Q [of the year] YYYY} {time: [Week] W [of the year] YYYY}
_

Try it out

  1. Create a new snippet and add a date or time command or copy the one above
  2. Try changing the format in which the date or time is presented

You can find all the available formats here

Shifting the date and time

But what if you want to insert yesterday's date? Or the time two hours from now? Move the date/time forward or backward using the shift setting.

There are two ways to shift the date command:

Option 1 - Shift an existing time command

  1. Click on the command you added (the command "pill")
  2. In the Shift setting, set the shift unit (Days, Weeks, Months, etc.)
  3. Set the shift value (1, 2, 5, 10, etc.)
  4. Try the snippet

Option 2 - insert a shifted time command

  1. Click on the shift menu
  2. Select the required shifted time
  3. Try the snippet

The example below shifts today's date forward by 1 day to insert tomorrow's date.

Tomorrow's date
Action items for tomorrow, {time: ddd, MMM Do, YYYY; shift=1D}
_

Try it out

  1. Create a new snippet and add a date or time command or copy the one above
  2. Try shifting the date or time using different Shift settings

Shifting to the beginning or end of a period

You can also shift the date to the beginning or end of a given period (e.g. week, month, quarter). In the example below, last quarter's number is dynamically presented along with the dates of the first and last days of the quarter.

Last quarter number, starting date and ending date
This is your statement for last quarter (Q{time: Q; shift=-1Q}), starting {time: MMMM DD, YYYY; shift=-1Q<Q} and ending {time: MMMM DD, YYYY; shift=-1Q>Q}
_

Try it out

  1. Create a new snippet and add a date or time command or copy the one above
  2. Try shifting the date to the end of the current week, month or quarter

Setting an anchor date

By default, the current date and time are used as the "anchor", but you can set any other date and time as the anchor. Do that by setting the At setting.

The example below sets the anchor to be July 4th 1776:

Day at a given date
The day on July 4, 1776 was {time: dddd; at=1776-07-04}
_

Advanced example

Greeting based on the time of day

This snippet determines the greeting (Good morning, Good evening, etc.) based on the time in which it is inserted. It uses the H time format, which gives the current hour (0-24) and an {if} command to determine the greeting.

Note: The {if} command is a Pro feature, but you can test it on the free plan.

Time-based greeting
Good {if: {time: H} < 12}morning{elseif: {time: H} < 17}afternoon{else}evening{endif}
_

Calculate the date 91 days from a selected date

This snippet allows you to select a date and writes the date 91 days later. You'll notice that the date selection is done inside a note and therefore is not typed when the snippet is inserted. The date selection is using a Form Date command (Pro feature) and then sets it as the date "anchor" using the At setting, which is then shifted by 91 days.

The date in 91 days from a selected date
{note}(Internal only)Start date: {formdate: YYYY-MM-DD; name=start_date}{endnote: trim=yes}The item is due {time: dddd; shift=+91D; at={=start_date}}, {time: MM-DD-YYYY; shift=+91D; at={=start_date}}
_

Calculate the date x weekdays from a selected date

Similarly, this snippet asks for a start date and the duration in weekdays and calculates the expected end date.

It uses the Form Date command to get the date and a Form Text command to get the duration in weekdays. It then anchors the date to the one selected in the Form Date and shifts it by the number of weekdays selected in the Form Text.

x weekdays from a selected date
We plan to start working on the project on{formdate: YYYY-MM-DD; name=start_date}. The expected duration of the project is {formtext: name=weekdays; default=5} weekdays. We expect to have the deliverables back to you by {time: dddd, YYYY-MM-DD; shift=+{=weekdays}D(skip=SAT, SUN); at={=start_date}; pattern=YYYY-MM-DD}
_

Calculate someone's age based on their date of birth

Pretty self-explanatory...

The X time format produces the current time in seconds (the number of seconds that have passed since 1 Jan 1970).

This snippet uses the Form Date command to capture the birthdate. Then it calculates the number of seconds currently and at the date of birth. The difference between the two is then converted to years using a formula.

Calculate age based on DOB
The patient was born: {formdate: YYYY-MM-DD;name=DOB}. Currently {=floor(diff/(60*60*24*365))} years old {note}{diff={time: X}-{time: X; at={=DOB}}}{endnote: trim=yes}
_

Calculate the date of a day next week

This snippet calculates the date of a given day next week.

It uses a drop-down menu (the Form Menu command) to capture the day and then uses a sophisticated shifting to a boundary, with the day set as the boundary.

The Pattern setting is used to tell Text Blaze what format is used for the "anchor" (The At setting).

Future date at a given day of the week
{note}Next meeting day: {formmenu: name=day; Monday; Tuesday; Wednesday; Thursday; Friday; Saturday; Sunday}{endnote: trim=right} Here's the agenda for our upcoming weekly staff meeting on {time: dddd, MMMM Do; shift=>{=upper({time: ddd; at={=day}; pattern=dddd})}}.
_

If you'd like to read more, check out the complete documentation page (video included): https://blaze.today/commands/time/

  • Guides
    • Quick Start
    • Sharing Snippet Folders
    • Dynamic Commands
    • Date and Time
    • Autopilot
    • Forms
    • Tidying Whitespace
    • Lists
    • Teams and Organizations
  • Tutorial Videos
  • Showcase
  • Frequently Asked Questions
  • Formula Reference
  • Dynamic Commands
    • Using Dynamic Commands
    • {=} (Formula Command)
    • {click}
    • {clipboard}
    • {cursor}
    • {error}
    • {formdate}
    • {formmenu}
    • {formparagraph}
    • {formtext}
    • {formtoggle}
    • {if}
    • {import}
    • {key}
    • {link}
    • {note}
    • {repeat}
    • {site}
    • {snippet}
    • {time}
    • {user}
    • {wait}
  • Connected Snippets
    • Connected Snippets Overview
    • {image}
    • {urlload}
    • {urlsend}
    • {dbselect}
    • {dbinsert}
    • {dbupdate}
    • {dbdelete}
  • Command Packs
    • Capitalize
    • Gmail
    • LinkedIn
    • Randomize

About

Plans and Pricing
Sharing Snippets
Text Blaze for Business
Forms
Autopilot
Dynamic Commands
Command Packs

Support

Get Started with Text Blaze
Contact Us
Documentation
Community Forum
Blog

Solution for

Teams
Customer Support
Recruiters
Education
Healthcare
Sales
Property Managers

Other

Privacy Policy
Terms of Service
Open Source Licenses
Affiliate
© 2023 Blaze Today Inc