'\" te .\" Copyright 1989 AT&T. .\" Portions Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. .TH stime 2 "14 Jul 2015" "SunOS 5.11" "System Calls" .SH NAME stime \- set system time and date .SH SYNOPSIS .LP .nf #include \fBint\fR \fBstime\fR(\fBconst time_t *\fR\fItp\fR); .fi .SH DESCRIPTION .sp .LP The \fBstime()\fR function sets the system's idea of the time and date. The \fItp\fR argument points to the value of time as measured in seconds from 00:00:00 UTC January 1, 1970. .SH RETURN VALUES .sp .LP Upon successful completion, \fB0\fR is returned. Otherwise, \fB\(mi1\fR is returned and \fBerrno\fR is set to indicate the error. .SH ERRORS .sp .LP The \fBstime()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 13n .rt The \fItp\fR argument points to an invalid (negative) value. .RE .sp .ne 2 .mk .na \fB\fBEPERM\fR\fR .ad .RS 13n .rt The {\fBPRIV_SYS_TIME\fR} privilege is not asserted in the effective set of the calling process. .RE .sp .ne 2 .mk .na \fB\fBEINTR\fR\fR .ad .RS 13n .rt The calling process belongs to a non-global zone and receive a signal while setting the time. .RE .sp .ne 2 .mk .na \fB\fBECANCELED\fR\fR .ad .RS 13n .rt The calling process belongs to a non-global zone and there exists an internal I/O error. .RE .SH SEE ALSO .sp .LP \fBtime\fR(2), \fBprivileges\fR(5)