date format problem

jtdancemusician's icon

Hi,

I need to output a file with the date format mm:dd:yyyy and time format hh:mm:ss. I use the date object to output the date and time.

However, if the date is 1-9, and the minutes or secs 1-9, I can't get the 0 before the number to show. I can't use prepend because it puts a space between the 0 and the single integer, and attemps to query a coll (for example "1, 01; 2, 02; etc.) don't work either--Max keeps removing the 0 before the single integer.

Any ideas?

Thanks.

volker böhm's icon

> I need to output a file with the date format mm:dd:yyyy and time
> format hh:mm:ss. I use the date object to output the date and time.
>
> However, if the date is 1-9, and the minutes or secs 1-9, I can't
> get the 0 before the number to show.

[sprintf] is what you're looking for.
this has come up a couple of times before, so you might find more
info in the archive.
try this:

Max Patch
Copy patch and select New From Clipboard in Max.

jtdancemusician's icon

Thanks! That's great!