How to get number date with dashes?

hi, how do i make a macro that types the number date but that uses dashes instaed of slashes? thanks! -todd

I use a macro triggered by 'this string is typed', you can use any trigger though including a palette.
then use "insert text by typing" action you could use paste too and in the dialogue box I put this

%ICUDateTime%YYYY-MM-dd%

The letters will produce a date in that format. You can change the format by editing the text as outlined in this wiki article. I think that when I made this I just entered the dashes by editing the text and inserting the format manually. I am not sure if one should really use an en dash? So be careful with that and check as to what is the correct dash: the hyphen is what I have in the example. I am not quite sure if that is what is best practice for dates and maybe somebody else can clarify.

https://wiki.keyboardmaestro.com/token/ICUDateTime

1 Like

thank you very much, that worked great!

i was going to try doing something complex with the curser moving around and replacing the slashes, lol.

good question about the en dash in number dates, i changed it to a non en dash regardless :slight_smile:

thanks again!
-todd

1 Like

I think it is normally just a hyphen that is normally used: I checked a bit after writing, I edited my first reply. I use a regular hyphen but I am not 100% sure what the proper way is. I think I over thought that one. I would like to hear what the 'correct' way is really. I hope the regular hyphen is right since I have oddles of material using that!

hi, i couldn't easily find info on that. i think the en dash is just used for a range, so for a number date i'm guessing a non en dash is correct. i'm a writer, but i'm also a designer, so i use whatever looks good to me lol... for example, in typeset copy i use a space, then en dash, then space, instead of using an em dash with no spaces (which looks odd to me). :slight_smile:

1 Like

I think you have it right!, thanks it helped me clarify. Whew! a bit of a relief in fact. I agree with you as to the better look of things too. That helped me clarify those dashes, which funny enough have been excercising me a bit recently.

1 Like

:slight_smile:

1 Like