Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I want to get the time, but i dont want to use the system time..coz somebody may change it.
I am implementing a SMTP relay server to delay the mails for some "x"-minutes. so that i have to check the time. In this place i cant use the systme time,coz as i said somebody can change it.
Is there any other clock in unix..machines..runnning uniquely..regardless of the system time?
Note : I dont want to get the exact time. I just want a clock to find the delay time.
SLEEP(1) User Commands SLEEP(1)
NAME
sleep - delay for a specified amount of time
SYNOPSIS
sleep NUMBER[SUFFIX]...
sleep OPTION
DESCRIPTION
Pause for NUMBER seconds. SUFFIX may be ‘s’ for seconds (the default), ‘m’ for minutes, ‘h’ for
hours or ‘d’ for days. Unlike most implementations that require NUMBER be an integer, here NUM‐
BER may be an arbitrary floating point number.
--help display this help and exit
--version
output version information and exit
AUTHOR
Written by Jim Meyering and Paul Eggert.
Last edited by Simon Bridge; 05-14-2006 at 10:50 PM.
Any PC, regardless of the operating system, always maintains it's own time on a hardware clock.
Unfortunately, those clocks are known to be inaccurate and -as you already pointed out yourself- the users
can alter the time/date.
If you want to get the universally correct time, you should consider setting up NTP to retrieve
the exact time from a world-wide server.
Likewise, once you got one machine that queries those servers, you can setup your other machines to contact your first machine, thus "propagating" the correct time accross your machines.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.