Menu

[0a35e6]: / src / rtlib / win32 / time_setdate.c  Maximize  Restore  History

Download this file

27 lines (21 with data), 531 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "../fb.h"
#include <windows.h>
int fb_hSetDate( int y, int m, int d )
{
/* get current local time and date */
SYSTEMTIME st;
GetLocalTime( &st );
/* set time fields */
st.wYear = y;
st.wMonth = m;
st.wDay = d;
/* set system time relative to local time zone */
if( SetLocalTime( &st ) == 0) {
return -1;
}
/* send WM_TIMECHANGE to all top-level windows on NT and 95/98/Me
* (_not_ on 2K/XP etc.) */
/* if ((GetVersion() & 0xFF) == 4)
SendMessage(HWND_BROADCAST, WM_TIMECHANGE, 0, 0); */
return 0;
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.