How to format the date and time

Format the date with locale-dependent settings, including the date separator characters, and format date as European, American or Japanese

Use TTime::FormatL() to format the locale-dependent aspects of the time, including the time separator characters, whether a 12 or 24 hour clock is to be used, and whether am/pm text should be located before or after the time.

TTime homeTime;
TBuf<32> buf;

// get home time and format it locale dependently
homeTime.HomeTime();

_LIT(KFormatTxt,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
homeTime.FormatL(buf,KFormatTxt); 

// This gives 19/05/1997 9:44:51 am, assuming 12 hour clock with     
// trailing am/pm text, am/pm space between, and European date format