Notepad++ snippets

How to convert datetime DD-MM-YYYY to YYYYMMDD in Notepad++

Let say you have the following dates:

Notepad++ replace 1

  • 26-03-1985
  • 15-01-2000
  • 11-09-1974
  • 30-05-1999

that you want to transform into YYYYMMDD:

Notepad++ replace 3

  • 19850326
  • 20000115
  • 19740911
  • 19990530

To do this transformation you can just hit CTRL + H for Replace window and the select the following:

Notepad++ replace 2

  • Find what: (\d+)-(\d+)-(\d+)
  • Replace with: $3$2$1
  • Flag Regular expression
  • Do not flag . matches new lines

Back to Notepad++ cookbook page