Borland C++ reference

stime

raw OCR

Sets system date and time.

Defined in header <time.h>

Syntax

#include <time.h>
int stime(time_t *tp);

Portability

DOSUNIXWindowsANSI CC++ only
■■■

Remarks

stime sets the system time and date, tp points to the value of the time as measured in seconds from 00:00:00 GMT, January 1,1970.

Return value

stime returns a value of 0.

See also

Example

#include <stdio.h>
#include <time.h>

int main(void)
{
   time_t t;
   t = time (NULL);

   printf("Current date is  %s", ctiem(&t));
   t -= 24L*60L*60L;  /* Back up  to same time previous day. */
   stime(&t);
   printf ("\nNew date is %s", ctime(&t));
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.