stime(2) System Calls Manual stime(2)NAME
stime() - set time and date
SYNOPSIS DESCRIPTION
The system call sets the system time and date. tp points to the value of time as measured in seconds from 00:00:00 on January 1, 1970,
Coordinated Universal Time (UTC).
Security Restrictions
Some or all of the actions associated with this system call require the privilege. Processes owned by the superuser will have this privi-
lege. Processes owned by other users may have this privilege, depending on system configuration. See privileges(5) for more information
about privileged access on systems that support fine-grained privileges.
RETURN VALUE
returns the following values:
Successful completion.
Failure.
is set to indicate the error.
ERRORS
If fails, is set to one of the following values.
The calling process does not have the
privilege.
The parameter points to an invalid (negative) time value.
The parameter is an invalid address.
SEE ALSO date(1), gettimeofday(2), time(2), privileges(5).
STANDARDS CONFORMANCE stime(2)
Check Out this Related Man Page
settimeofday(2) System Calls Manual settimeofday(2)NAME
settimeofday - set the date and time
SYNOPSIS DESCRIPTION
The function sets the current time, expressed as seconds and microseconds since Epoch, and passed as the structure pointed to by tp.
The resolution of the system clock is one microsecond.
Security Restrictions
Setting the time of day requires the privilege (SYSATTR). Processes owned by the superuser will have this privilege. Processes owned by
other users may have this privilege, depending on system configuration.
See privileges(5) for more information about privileged access on systems that support fine-grained privileges.
PARAMETERS
tp A pointer to a structure in which the current time is returned.
The structure includes the following members:
tzp If this parameter is not a null pointer, it is interpreted as a pointer to a structure under HP-UX. The structure has the following
fields:
tz_minuteswest The number of minutes that the local time zone is west of Coordinated Universal Time (UTC) or Epoch.
tz_dsttime A flag that, if nonzero, indicates that Daylight Savings Time (DST) applies locally during the appropriate part of the
year.
RETURN VALUE
returns the following values under HP-UX:
Successful completion.
Failure.
is set to indicate the error.
ERRORS
If fails, is set to the following value under HP-UX:
An argument address referenced invalid memory.
The member of the tp parameter to was less than zero or greater than 2^31.
A user lacking appropriate privileges attempted to
set the time.
WARNINGS
Relying on a granularity of one microsecond may result in code that is not portable to other platforms.
AUTHOR
was developed by the University of California, Berkeley, and HP.
SEE ALSO date(1), ftime(2), gettimeofday(2), stime(2), time(2), ctime(3C), privileges(5).
settimeofday(2)
Hello all,
I wish to set the time and date of the system from my application. (I write code in C ).
How can it be done?
I found the function stime() - but it gets time in seconds as a parameter, and I don't know how to convert my time & date to seconds since EPOCH.
What's the best... (0 Replies)
Hello Everyone,
I have been trying to complete a shell script where, I need to increment the date depending on the file (depending on the date) availability on the remote server.
i.e.
Basically, I will be passing a counter (like parameter 1 or 2 or 3 or 4).
First I will check for the... (1 Reply)
Hi all,
how to get the same time in two systems,
for example:
in one system i have the correct time, and second system i have wrong time.
now i want the first sytem to second sytem, i dont to want to do this work manually.
i know there is one command to get the time. in ntp.
... (3 Replies)
Frineds I need assistance in writing a script . Newbie to scripting.
How to find list of processes that are running more than an hour . Below i used the step to get the etime and stime . Now by getting the result i need to display longer time process with full listing.
ps -aef -o... (10 Replies)
Hi! All,
I am trying to reset the date and time since the change in time over the weekend. I cannot issue the command date -t 201703131330.
The system gives me an error invalid option.
This happens on my SCO OpenServer 5.0.7 and 5.0.6. Do anyone have an idea why? I even tried using... (6 Replies)