例えば、ファイル名が今日の日付になっているMarkdownファイル 2021-10-21.md を作りたい場合。
カスタム日付フォーマットを yyyy-MM-dd.md
にしてみると、
.md の m の部分が○時1分の「1」に、そして d の部分が○月21日の「21」に変換されて「.121」となってしまう。
All non-letter characters represent themselves in a pattern, except for the single quote. It is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
UTS #35: Unicode LDML: Dates
Unicode技術標準#35のWebページのこの章の最後の文の通り、変換して欲しくない部分を .'md'
とシングルクォートで囲むと、
と意図通りに変換してくれた。
シングルクォート自体を表示したい場合は、シングルクォートの囲いの内だろうが外だろうがシングルクォートを2つ続ける。