do you know of any api in c++ that could give me time in this format:

I used strtime in lccwin32 but it is not compatible with other compilers

Other C compilers use strftime() ...

#include <time.h>
size_t strftime(char *s, size_t maxsize, const char *fmt, const struct tm *t);

... with this as a typical example ...

#include <stdio.h>
#include <time.h>
#include <dos.h>

int main(void)
   struct tm *time_now;
   time_t secs_now;
   char str[80];

   time_now = localtime(&secs_now);
   strftime(str, 80,
            "It is %M minutes after %I o'clock (%Z)  %A, %B %d 19%y",
   return 0;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.