You can't do this directly with standard TStamp task. That allows you to format your timestamp using patterns defined in SimpleDateFormat, and there is no format symbol for day of week as a number.
I guess you could write a custom TStamp task.
However, this works.
Create a set of properties files, named using 3-letter day name:
$ find daysOfWeek/
daysOfWeek/
daysOfWeek/Fri.properties
daysOfWeek/Mon.properties
daysOfWeek/Sat.properties
daysOfWeek/Sun.properties
daysOfWeek/Thu.properties
daysOfWeek/Tue.properties
daysOfWeek/Wed.properties
In each file, define a single property for the corresponding day number, e.g.
$ cat daysOfWeek/Thu.properties
day.num=5
In your build script, first get a property matching today's day name, then load the corresponding properties file, then you can reference the day.num property.
<project>
<tstamp>
<format property="day.name" pattern="E" locale="en/US"/>
</tstamp>
<property file="daysOfWeek/${day.name}.properties"/>
<echo message="${day.name}"/>
<echo message="${day.num}"/>
</project>
Output today (Thursday) is
$ ant
Buildfile: build.xml
[echo] Thu
[echo] 5
BUILD SUCCESSFUL
Total time: 0 seconds