The use of /usr/xpg4/bin
in your $PATH only selects the standard compliant commands, it does not change function calls in your programs to use the standards compliant versions.
As described in the Solaris standards(5) man page there are various #defines and compiler flags you need to use to specify compliance for various standards.
For instance, taking your code snippet and expanding it to this standalone test program:
#include <sys/types.h>
#include <time.h>
#include <stdio.h>
int main(int argc, char **argv)
{
time_t lt;
struct tm *ltime;
char curr_date[80];
lt = time(NULL);
ltime = localtime(<);
strftime(curr_date, sizeof(curr_date), "%m/%d/%y%C", ltime);
printf("%s\n", curr_date);
return 0;
}
Then compiling with the different flags shows the different behavior:
% cc -o /tmp/strftime /tmp/strftime.c
% /tmp/strftime
06/30/13Sun Jun 30 20:28:00 PDT 2013
% cc -xc99 -D_XOPEN_SOURCE=600 -o /tmp/strftime /tmp/strftime.c
% /tmp/strftime
06/30/1320
The default mode is backwards compatible with the traditional Solaris code, the second form requests compliance with the C99 and XPG6 (Unix03) standards.