User talk:Patrickchuad

Date2str function can be found at AOT, system Documentation, Function Node. This convert the date specified to Text string.

The format is: Str Date2str (date date, int sequence, int day, int seperator1, int month, int separator2, int year).

date2str(today,213,1,4, 4,4,4);

returns January/25/2007

Explanation: 213 means that the sequence of display of day/month/year will be month (2) followed by Day (1) and the Year (3).

so if you want to display year first followup by day and then month, you should write 312 - year - day and month

2007/25/January
The next number 1 stand for the int value of day. If it is one then the display will be 9 if it is the 9th day of the month. If you write 2 - then the display will 09.

the next number 4 - stand for the separator 1, we have four values as separator, these are: 1 - " " space separator 2 - "." point separator 3 - "-" hypen separator 4 - "/" slash separator

In this sample case, we use 4 , so the separator is "/"

the next number is month int, same as day integer, we can display them in 1 digit or 2 digit. So if the month is below october the display will be 1 to 9. But if you use 2 it will 01 to 09. Of course for oct - dec, it will always be display as two digit.

Sometimes we want to display the month is char we can do so by using integer 3 which will display the month as Jan. If we use 4, it will display the entire lenght as January. So possible value for month are:

1 - display january as 1 2 - display january as 01 3 - display january as Jan 4 - display january as January

the next number is separtor2, same as the separator1. In this case it is 4 so we have "/"

Lastly we have the int for the year. If you want to display the year as 2 digit only, you use 2 else you use 4. In this case we use 4 so the year is displayed as 2007, intead of 07 if we use 2.

so to display the date in string format: 2007-5-October  we write

date dt; str dtstr; dt=mkdate(5,10,2007); dtstr=date2str(dt,312,1,3,4,3,4)

explanation:

312 - means year day month sequence 1 - means display the day in 1 digit 3 - means display the seperator as "-" hypen 4 - means display the month in whole lenght October 3 - means display the second separator as "-" hypen 4 - means display the year as 4 digits

--Patrickchuad 01:34, 26 January 2007 (EST)