# Don't type the date by hand

> I use the yyyy-mm-dd date _all the time_, but I never actually type it out. Here's how to have your computer generate it for you, and some other simple how-to-be-better-at-computering tips.

On Discord, [Jade asked](https://discord.com/channels/822215537589354566/1304673537486884887/1308718684486766683):

> Theres gotta be a better way of naming Amex (and other credit card statements) than this surely? I always struggle to remember the dates, but this just feels overwhelming, I usually just go with the statement date for naming credit card statements. Amex Ending 12345 - 2024 10 10 to 2024 11 09 - Statement 2024 11 09 - Due 2024 12 05

There are many situations where I recommend starting a filename (or folder) with the date. It works really well for almost any time-based document. Amex statements fall squarely in to that bucket.

## Which date?

For the record, this is the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date standard. Once you get in to date formatting[^you-will] you'll see that around, so it's good to know what it is.

[^you-will]: You will. Just wait.

That standard defines a bunch of formats, but the one we're interested in is the simple `yyyy-mm-dd`, i.e. `2024-11-21`. It's the only sensible format for your computer dates as it sorts chronologically. Use whatever other [weird crap](https://duckduckgo.com/?q=american+date+format+is+dumb&t=osx&ia=web) you want in your personal life.

The problem with this date is that it's a real pain to type out by hand. And first you have to remember the date! _Bo-ring_. Fortunately computers are good at a) knowing the date and b) generating text.

## Introducing Raycast

You're gonna need an app. There are many that do this. The venerable [TextExpander](https://textexpander.com) might have been the first, but we're going to use a reasonably new app: [Raycast](https://www.raycast.com).

Raycast is a beast. It does _so much_. But don't let that put you off – we can start to use it for the stuff we need, and over time you can explore the rest of its features.

It's free. There's a pro plan, but you don't need it. It's currently Mac only, but they're working on a Windows version.

So, install it. You can test it's working by pressing `Option-Space`. A little window should appear in the middle of your screen.

I won't go over any other Raycast features just now. The [manual is here](https://manual.raycast.com).

---

# Snippets

We're going to create a '[snippet](https://dictionary.cambridge.org/dictionary/english/snippet)'. How this works is that you type some sort of shortcut, and Raycast converts it to something else.

It's just like the feature on your iPhone that detects if you typed `teh` and corrects it to `the`. Or the one that corrects `█uck` to `duck`. You know.

There's a trick here, and it's in naming your snippets. You want to guarantee that whatever you type will **never ever** occur in normal daily typing. Because if your snippet trigger was `al`, every time you type that out Raycast will replace it for you.

So now instead of `Johnny.Decimal` you'll get `Johnny.Decim2024-11-21`. Not ideal.

## I recommend `;;`

I think this came from Merlin Mann _waaaay_ back in the [43 folders](https://www.43folders.com/2005/09/17/textpander-an-end-at-last-to-email-from-melrin) days (2005!).[^archive] If you start each of your snippets with two semicolons, you guarantee that you'll never trigger them by accident.

[^archive]: [Archive link](https://web.archive.org/web/20051227100557/http://www.43folders.com/2005/09/17/textpander-an-end-at-last-to-email-from-melrin/) in case that's down.

If you touch-type[^learn] they're under your right pinkie. So you mash `;;` and then the name of your snippet and _boom_ Raycast steps in and replaces it with something else.

[^learn]: And if you don't, [_learn_](https://keybr.com).

Let's drop a little video here in case you're wondering what I'm on about.

<video
  class="video-light"
  width="1748"
  height="482"
  autoplay
  loop
  muted
  playsinline
>
  <source
    src="/blog/0094-Raycast_textedit--light-1748x482.mp4"
    type="video/mp4"
  />
  Your browser does not support the video tag.
</video>

<video
  class="video-dark"
  width="1748"
  height="482"
  autoplay
  loop
  muted
  playsinline
>
  <source
    src="/blog/0094-Raycast_textedit--dark-1748x482.mp4"
    type="video/mp4"
  />
  Your browser does not support the video tag.
</video>

## Raycast: Create Snippet

Cool eh! Let's set it up.

1. Activate Raycast with `⌥ Space`. Type `create snippet` to find that command. Press `return`.
2. The `Name` helps you identify it in the future.[^search-snippets] Call it `YYYY-MM-DD` or whatever else you like.
3. The `Snippet` is what will appear when this is activated. Paste this in: `{date format="yyyy-MM-dd"}`. This is a little bit of code that Raycast understands. Include the curly brackets.
4. Scroll the window to reveal `Keyword`. This is what _you_ type to activate this snippet. I'd recommend `;;date` for this one.
5. Press `⌘ return` to save it.
6. Try it out!

[^search-snippets]: Raycast command `search snippets` will list them.

## Problem: it's today's date

As Jade is renaming lots of old files, this isn't _perfect_. But honestly I find even having the skeleton of a date format that I can then edit is more useful than starting from nothing.

### Tip: use `option-arrows` to move around

Another small computer power-user tip: hold `option` (`alt` on Windows) and use the left/right arrows. This jumps your cursor a word at a time, and it stops at the breaks between the numbers in the date.

This will speed up your editing.

## Why stop there?

In Jade's specific case, where she wants `yyyy-mm-mm Amex 12345`, there's nothing stopping you creating another custom snippet for that whole piece of text.

Repeat the process but now the `Snippet` should read `{date format="yyyy-MM-dd"} Amex 12345`. Maybe give that one the keyword `;;ax1`? Whatever makes sense to you.

We can do so much more with Raycast, but that's a good start. Let us know how that works for you, Jade!