Logo Text Blaze

  • Docs
  • Community
  • Documentation

    No search results

    Text Blaze

    Loading...

    Data Blaze

    Loading...

    Community Forums

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

{time}

Summary: Powerful and configurable time and date formatting.
Sample Usage
It is currently: {time: dddd, MMMM Do, YYYY} More briefly: {time: ddd, MMM Do, YYYY} Or even: {time: M/D/YY}

The current time is: {time: HH:mm:ss A} More briefly: {time: h:mm}

The time and date are: {time: ddd, MMM Do, YYYY [at] h:mm A}

Since it is {time: ddd, MMM Do, YYYY}, in 12 days it will be {time: ddd, MMM Do, YYYY; shift=+12D}.
_

Quick Overview Video

Settings


Setting NameTypeDescription
PositionaltextThe date/time format.
attextSet's the date/time.
patterntextFormat used to interpret at.
shifttextAn optional date/time shift.
localetextAn optional locale code (e.g. en-us or just en) used to format the time and date.
General Command Settings
trimyes/no/left/rightIf yes whitespace is removed before and after the command. If left, only whitespace to the left is removed. If right, only whitespace to the right is removed.

Time/Date Formatting

Text Blaze's time/date formatting syntax allows you to customize the output of your times and dates in various ways. It allows you to mix formatting with tokens that have special meanings.

For example, one way the current date could be entered is MMM Do, YYYY (resulting in the output of Nov 13th, 2017), and the current time could be specified with h:mm (resulting in the output of 11:24).

Text Blaze's time/date formatting syntax is based on Moment, a JavaScript library for parsing and formatting dates.

The following table (adapted from the Moment.js documentation website) contains the full list of support tokens:

TokenOutput
Month
M1 2 ... 11 12
Mo1st 2nd ... 11th 12th
MM01 02 ... 11 12
MMMJan Feb ... Nov Dec
MMMMJanuary February ... November December
Quarter
Q1 2 3 4
Qo1st 2nd 3rd 4th
Day of Month
D1 2 ... 30 31
Do1st 2nd ... 30th 31st
DD01 02 ... 30 31
Day of Year
DDD1 2 ... 364 365
DDDo1st 2nd ... 364th 365th
DDDD001 002 ... 364 365
Day of Week
d0 1 ... 5 6
do0th 1st ... 5th 6th
ddSu Mo ... Fr Sa
dddSun Mon ... Fri Sat
ddddSunday Monday ... Friday Saturday
Day of Week (Locale)
e0 1 ... 5 6
Day of Week (ISO)
E1 2 ... 6 7
Week of Year
w1 2 ... 52 53
wo1st 2nd ... 52nd 53rd
ww01 02 ... 52 53
Week of Year (ISO)
W1 2 ... 52 53
Wo1st 2nd ... 52nd 53rd
WW01 02 ... 52 53
Year
YY70 71 ... 29 30
YYYY1970 1971 ... 2029 2030
AM/PM
AAM PM
aam pm
Hour
H0 1 ... 22 23
HH00 01 ... 22 23
h1 2 ... 11 12
hh01 02 ... 11 12
k1 2 ... 23 24
kk01 02 ... 23 24
Minute
m0 1 ... 58 59
mm00 01 ... 58 59
Second
s0 1 ... 58 59
ss00 01 ... 58 59
Locale Formatted
LTEx: 7:10 AM
LTSEx: 7:10:46 AM
lEx: 9/22/1985
LEx: 09/22/1985
llEx: Sept 22, 1985
LLEx: September 22, 1985
lllEx: Sept 22, 1985 7:10 AM
LLLEx: September 22, 1985 7:10 AM
llllEx: Mon, Sept 22, 1985 7:10 AM
LLLLEx: Monday, September 22, 1985 7:10 AM
Unix Timestamp
X1360013296
Unix Millisecond Timestamp
x1360013296123
The Text Blaze time/date formatting syntax above is also used in the {formdate} command.

Setting the Time/Date

The optional at setting allows you to specify the time/date used by the time command. If the at setting is not explicitly set, the current time/date will be used.

Using "at"
The date at 2000-01-01 was: {time: dddd MMM D, YYYY; at=2000-01-01}.

Three year later it was: {time: dddd MMM D, YYYY; at=2000-01-01; shift=+3Y}.
_

The at setting will interpret many common date formats. If the at format does not recognize your date format, or your date format is ambiguous, or you want to specify a time; you can use the pattern setting to tell Text Blaze how to understand your date.

The pattern setting uses the Text Blaze time/date formatting syntax to tell Text Blaze how your time/date is structured.

For example, if your date was 2000-01-01 where you have Year-Month-Day, you would use a pattern of YYYY-MM-DD. If your date was instead Year-Day-Month, you could use the pattern YYYY-DD-MM.

Using a Pattern
An example using a custom formatted data "2000.01.01": {time: ll; at=2000.01.01; pattern=YYYY.MM.DD}.

Another example with a different custom formatted date "7 Jan (2012)": {time: ll; at=7 Jan (2012); pattern=D MMM (YYYY)}.
_

Time/Date Shifting

The optional shift setting lets you display a time/date in either the future or past. A time shift is specified to select a time period relative to the current time.

For example, to show the date 10 days from now, you could use {time: MMM Do, YYYY; shift=+10D}.

If the at setting is specified, any time shifts will be relative to that date.

Shifts are specified in terms of a base period like days or weeks. You can have a fixed shift like +2W (two weeks from the current time) or -5D (five days ago). You can also shift to the beginning or end of any standard date period. For example, <M will shift to the start of the current month, while >Y will shift to the end of the current year.

The following table summarizes the shifts relative to the standard periods.

PeriodBase PeriodExample Fixed ShiftStart and End Period Shift
Secondss5s<s and >s
Minutesm-4m<m and >m
Hoursh24h<h and >h
DaysD2D<D and >D
WeeksW5W<W and >W
MonthsM-10M<M and >M
QuartersQ1Q<Q and >Q
YearsY3Y<Y and >Y

You can also shift forward or backward to a specific day of the week. For example, >MON will shift forward to the nearest Monday. If the current date is a Monday, no shift will take place. <MON will shift backwards to the nearest Monday. Again, if the current date is a Monday, no shift will take place.

DayLabelCurrent or Previous ShiftCurrent or Following Shift
SundaySUN<SUN>SUN
MondayMON<MON>MON
TuesdayTUE<TUE>TUE
WednesdayWED<WED>WED
ThursdayTHU<THU>THU
FridayFRI<FRI>FRI
SaturdaySAT<SAT>SAT

You can combine multiple shifts together. For example, +10Y -2D would shift the date by a total of 10 years minus 2 days. +10D >MON would shift the date 10 days and then to the following Monday.

This is particularly useful if you want to implement something like "find the next Monday". If you just used >MON and the current day is a Monday, it will not shift at all. You instead could use +1D >MON to increment the day by one, and then move forward to the nearest Monday.

The following examples show how you might use date shifting to specify specific dates.

Date/Time Shifting
Current date: {time: MMMM D, YYYY} In ten days it will be: {time: MMMM D, YYYY; shift=+10D} Ten days ago it was: {time: MMMM D, YYYY; shift=-10D}

The first day of the month was: {time: MMMM D, YYYY; shift=<M} The last day of the month will be: {time: MMMM D, YYYY; shift=>M}

The last Friday of the quarter is: {time: MMMM D, YYYY; shift=>Q <FRI} The first Monday of next year will be: {time: MMMM D, YYYY; shift=+1Y <Y >MON}
_

When shifting by days, you can skip certain days of the week. For example, if you wanted to shift 10 weekdays into the future you could use the following:

Skipping specific days of the week
In ten weekdays it will be: {time: MMMM D, YYYY; shift=+10D(skip=SAT, SUN)}
_

Locales and Localization

It's possible to override the locale for individual {time} commands using the locale setting.

If not specified, {time} command will attempt to use the locale specified in your Text Blaze account settings when formatting the time/date.

A list of available language locales are available in your Account Settings page under the Locale & Formatting header.

Locales
In America, the current date and time might be written: {time: LLLL; locale=en-us}

In France, we might use: {time: LLLL; locale=fr}

And in China, we might see: {time: LLLL; locale=zh}
_
  • Guides
    • Quick Start
    • Sharing Snippet Folders
    • Dynamic Commands
    • Date and Time
    • Autopilot
    • Forms
    • Formulas
    • Rules & Validation
    • Tidying Whitespace
    • Lists
    • Teams and Organizations
  • Tutorial Videos
  • Academy
    • Intro to commands
  • 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
Text Blaze for Windows

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