mirror of
https://github.com/reactos/reactos.git
synced 2024-10-23 14:36:11 +00:00
[VERSION]
Replace binary tool in repository by a Windows one to get current date. (supported since Windows XP/2003) svn path=/trunk/; revision=59294
This commit is contained in:
parent
54332ae012
commit
1d319c931b
|
@ -1,7 +1,9 @@
|
||||||
macro(today RESULT)
|
macro(today RESULT)
|
||||||
if(CMAKE_HOST_WIN32)
|
if(CMAKE_HOST_WIN32)
|
||||||
execute_process(COMMAND "${REACTOS_SOURCE_DIR}/tools/getdate.exe" OUTPUT_VARIABLE ${RESULT})
|
execute_process(COMMAND wmic os get LocalDateTime OUTPUT_VARIABLE RAWDATE)
|
||||||
string(STRIP ${${RESULT}} ${RESULT})
|
string(REPLACE "\n" ";" RAWDATE ${RAWDATE})
|
||||||
|
LIST(GET RAWDATE 1 RAWDATE)
|
||||||
|
string(SUBSTRING ${RAWDATE} 0 8 ${RESULT})
|
||||||
elseif(CMAKE_HOST_UNIX)
|
elseif(CMAKE_HOST_UNIX)
|
||||||
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE ${RESULT})
|
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE ${RESULT})
|
||||||
string(STRIP ${${RESULT}} ${RESULT})
|
string(STRIP ${${RESULT}} ${RESULT})
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
#include <time.h>
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
char curdate[9];
|
|
||||||
time_t now;
|
|
||||||
struct tm *tm_now;
|
|
||||||
|
|
||||||
time(&now);
|
|
||||||
tm_now=localtime(&now);
|
|
||||||
strftime(curdate, sizeof(curdate), "%Y%m%d", tm_now);
|
|
||||||
printf("%s", curdate);
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
gcc getdate.c -o getdate.exe -s
|
|
Binary file not shown.
Loading…
Reference in a new issue