Converting time to mm/dd/yyyy

To convert the time format returned by the "now" Inspector into mm/dd/yyyy format, you extract the three components (month, day, year) and then concatenate them with slashes. Start with the date portion of now (excludes the time portion):

Q: date (local time zone) of now
A: Mon, 25 Sep 2006
I: date

This returns a date with the elements we want to rearrange. The "month" Inspector can give us a properly formatted numeric month (two-digits, with a leading zero):

Q: (month of date (local time zone) of now) as two digits
A: 09
I: string

The "day_of_month" Inspector returns the date, which we format as above:

Q: day_of_month of date (local time zone) of now as two digits
A: 25
I: day of month

The year Inspector rounds things out:

Q: year of date (local time zone) of now as string
A: 2006
I: string

Concatenate these components with slashes to finish it off:

Q: (month of date (local time zone) of now) as two digits & "/" & 
day_of_month of date (local time zone) of now as two digits & "/" 
& year of date (local time zone) of now as string
A: 09/25/2006
T: 0.263 ms
I: string

This can be improved considerably by calling the "now" function only once and referring to it elsewhere with the keyword "it":

Q: (month of it as two digits & "/" & day_of_month of it as two digits 
& "/" & year of it as string) of date (local time zone) of now
A: 09/25/2006
T: 0.170 ms
I: string

This version is shorter, easier to read and about a third faster. Perhaps of greater importance, the value of now can change between invocations, so you may actually get a wrong answer with the first technique. On New Year’s Eve, for instance, you might get December coupled with the wrong year.