a display problem in using object [date]

prko's icon

Dear users,

Today is 5th ?October 2009.
I can get this information by using object [date].
It produces the date of today as the following:
1052009

However, I want to produce the following:
10052009

How can I reach my wish?

Best,
prko

bkshepard's icon

Max doesn't like integers to have a zero in front of them. Thus, as an integer, 04 always gets converted to 4. The only way to do it, is to convert the integer to a symbol "04". Since both the months and the dates can have a zero in front of them, you need to be able to fix both. This example uses [combine] to make a symbol with a leading zero out of integers lower than 10, and then uses another combine to string them all together in the mmddyyyy format you want.

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

prko's icon

thanks!

bkshepard's icon

For an even simpler version, replace the [if] objects with [split 1 9]. Hook 'em up the same way.

prko's icon

thanks!
It is amazing!

best,
prko