FreeBASIC  0.91.0
time_settime.c
Go to the documentation of this file.
1 #include "../fb.h"
2 #include <sys/time.h>
3 
4 int fb_hSetTime( int h, int m, int s )
5 {
6  struct timeval tv;
7  gettimeofday( &tv, NULL );
8  tv.tv_sec -= (tv.tv_sec % 86400);
9  tv.tv_sec += (h * 3600) + (m * 60) + s;
10  if( settimeofday( &tv, NULL ) )
11  return -1;
12  return 0;
13 }