• 0

[C] Displaying system date in yyyymmdd format?


Question

5 answers to this question

Recommended Posts

  • 0

So far I researched this, which works

#include <time.h>

#include <stdio.h>

#include <sys/types.h>

#include <sys/timeb.h>

#include <string.h>

int main()

{

char tmpbuf[128];

_strdate( tmpbuf );

printf( "OS date:\t\t\t\t%s\n", tmpbuf );

}

no idea about getting it into 20041109 format

  • 0
  INFERNO2k said:
So far I researched this, which works

#include <time.h>

#include <stdio.h>

#include <sys/types.h>

#include <sys/timeb.h>

#include <string.h>

int main()

{

    char tmpbuf[128];

    _strdate( tmpbuf );

    printf( "OS date:\t\t\t\t%s\n", tmpbuf ); 

}

no idea about getting it into 20041109 format

584894758[/snapback]

Must be a Windows only thing, doesn't work for me in Linux.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.