:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / lib / crtdll / time / strdate.c
1 /*
2  * COPYRIGHT:   See COPYING in the top level directory
3  * PROJECT:     ReactOS system libraries
4  * FILE:        lib/crtdll/time/strtime.c
5  * PURPOSE:     Fills a buffer with a formatted date representation
6  * PROGRAMER:   Boudewijn Dekker
7  * UPDATE HISTORY:
8  *              28/12/98: Created
9  */
10 #include <crtdll/time.h>
11 #include <crtdll/stdio.h>
12 #include <crtdll/errno.h>
13 #include <crtdll/internal/file.h>
14
15 char *_strdate( const char *datestr )
16 {
17
18         time_t t;
19         struct tm *d;
20         char *dt = (char *)datestr;
21
22         if ( datestr == NULL ){
23                 __set_errno(EINVAL);
24                 return NULL;
25         }
26         t =  time(NULL);
27         d = localtime(&t);
28         sprintf(dt,"%d/%d/%d",d->tm_mday,d->tm_mon+1,d->tm_year);
29         return dt;
30 }