Format date number to 2 digits: 01, 02, 03, ... 09, 10 etc
I am using the [date] object to name recordings made in a Max patch according to the time and date they were recorded. Since, I am sorting these recordings in numeric order unfortunately the number 2 for example will show up after the number 11 even though it was recorded earlier. I need to reformat the number 2 to the number 02 instead. That way 02 sorts before 11 as it should! I tried [sprintf] and other text number formatting, but a zero on the front of a number always disappears! help please.
here is an example patch:
if you had read the help file of sprintf you wuld have discovered the easy way to add leading zeros:
Thanks pid! I noticed that this only works if you add a letter before the zero. That why it didn't work for me earlier.
Anyway to remove the letter and keep the zero?
I would like my dates to look clean without extra characters if possible.
See edited pid patch:
ah i see.
[combine] then...