however - excel and libreoffice have difficulties identifying it as time -
is there anyway to change the way ctime outputs -
like mm/dd/yy hh:mm:ss ?
1 2 3 4 5 6 7 8 9 10 11 12 13
/* ctime example */
#include <stdio.h> /* printf */
#include <time.h> /* time_t, time, ctime */
int main ()
{
time_t rawtime;
time (&rawtime);
printf ("The current local time is: %s", ctime (&rawtime));
return 0;
}
POSIX marks this function obsolete and recommends std::strftime instead.
this is from the std::ctime() link sent earlier and going through that link it does appear that std::strftime() offers additional functionalities that allow the user to determine the format of the output right at the stage of the function call rather than manipulating the function's return values as was the case with std::ctime().
for e.g. you could get your desired output format straight-off in the following manner: