ReactOS
0.4.16-dev-303-g11d5cb8
wstrdate.c
Go to the documentation of this file.
1
/*
2
* COPYRIGHT: See COPYING in the top level directory
3
* PROJECT: ReactOS CRT library
4
* FILE: lib/sdk/crt/time/wstrdate.c
5
* PURPOSE: Fills a buffer with a formatted date representation
6
* PROGRAMER: Ariadne
7
* UPDATE HISTORY:
8
* 28/12/98: Created
9
*/
10
#include <precomp.h>
11
12
/*
13
* @implemented
14
*/
15
wchar_t
*
_wstrdate
(
wchar_t
*
date
)
16
{
17
static
const
WCHAR
format
[] = {
'M'
,
'M'
,
'\''
,
'/'
,
'\''
,
'd'
,
'd'
,
'\''
,
'/'
,
'\''
,
'y'
,
'y'
,0 };
18
19
GetDateFormatW
(
LOCALE_NEUTRAL
, 0,
NULL
,
format
, (
LPWSTR
)
date
, 9);
20
21
return
date
;
22
23
}
24
25
int
CDECL
_wstrdate_s
(
wchar_t
*
date
,
size_t
size
)
26
{
27
if
(
date
&&
size
)
28
date
[0] =
'\0'
;
29
30
if
(!
date
) {
31
*
_errno
() =
EINVAL
;
32
return
EINVAL
;
33
}
34
35
if
(
size
< 9) {
36
*
_errno
() =
ERANGE
;
37
return
ERANGE
;
38
}
39
40
_wstrdate
(
date
);
41
return
0;
42
}
EINVAL
#define EINVAL
Definition:
acclib.h:90
ERANGE
#define ERANGE
Definition:
acclib.h:92
NULL
#define NULL
Definition:
types.h:112
CDECL
#define CDECL
Definition:
compat.h:29
size
GLsizeiptr size
Definition:
glext.h:5919
GetDateFormatW
INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut)
Definition:
lcformat.c:993
date
__u16 date
Definition:
mkdosfs.c:8
LOCALE_NEUTRAL
#define LOCALE_NEUTRAL
_errno
_CRTIMP int *__cdecl _errno(void)
Definition:
errno.c:17
format
Definition:
format.c:58
_wstrdate
wchar_t * _wstrdate(wchar_t *date)
Definition:
wstrdate.c:15
_wstrdate_s
int CDECL _wstrdate_s(wchar_t *date, size_t size)
Definition:
wstrdate.c:25
WCHAR
__wchar_t WCHAR
Definition:
xmlstorage.h:180
LPWSTR
WCHAR * LPWSTR
Definition:
xmlstorage.h:184
sdk
lib
crt
time
wstrdate.c
Generated on Sun Dec 1 2024 06:16:24 for ReactOS by
1.9.6