home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
NETCLB35.ZIP
/
NETCLB35.EXE
/
EXAMPLES
/
STIME.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-03
|
2KB
|
53 lines
/***************************************************************************/
/* File: STIME.C */
/* */
/* Function: Output current server date and time. */
/* */
/* Usage: stime */
/* */
/* Functions Called: GetFileServerDateTime */
/* GetPreferredConnectionID */
/* GetDefaultConnectionID */
/* GetPrimaryConnectionID */
/* SetPreferredConnectionID */
/* ISShellLoaded */
/* */
/***************************************************************************/
#include "netware.h"
#include <stdio.h>
static char *days[] = { "Sunday" , "Monday" , "Tuesday" , "Wednesday" ,
"Thursday" , "Friday" , "Saturday" };
void main( void )
{
nw_time ctime;
nw_date cdate;
int h,m,s,d,mth,y,dow;
int thisserver,prefserver;
if (IsShellLoaded() != SUCCESS)
{
printf("*** No netware shell loaded ***\n");
return;
}
if ((prefserver = GetPreferredConnectionID()) == 0)
{
if ((thisserver = GetDefaultConnectionID()) == 0)
thisserver = GetPrimaryConnectionID();
SetPreferredConnectionID( thisserver );
}
else
thisserver = prefserver;
GetFileServerDateTime(&ctime,&cdate,&dow);
printf("Today is %s\n",days[dow]);
printf("%02.2d-%02.2d-%04.4d__%02.2d:%02.2d:%02.2d\n",
cdate.day,cdate.month,cdate.year,
ctime.hours,ctime.minutes,ctime.seconds);
if (thisserver != prefserver) /* reset preferred server */
SetPreferredConnectionID( prefserver );
}