Where are you when you execute your commands?
On what kind of file system?
Just so we agree on your output, can you type it again but this time I suggest you type:
For it doesnt look like a timezone issue but more like 2 boxes not having the time since one says 27min and the other 21...
Greetings all,
I have been battling with this problem for some time now, and I am not sure if I am just not seeing the obvious anymore or have made a stupid mistake, but I just can seem to get the reverse address in my network to run the right way.
Short description of my network:
I have a... (3 Replies)
1. The problem statement, all variables and given/known data:
When looking for corefiles, include any file with core in its name. (Some UNIX/Linux systems add the PID of the process that created the core to reduce the chances of overwriting an already existing core file that might be needed. The... (6 Replies)
Hi All,
I am new to unix programming. I am trying for a requirement and the requirement goes like this.....
I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
I need to be able to identify files with file timestamps greater than a given timestamp.
I am using the following solution, although it appears to compare files at the "seconds" granularity and I need it at the milliseconds. When I tested my solution, it missed files that had timestamps... (3 Replies)
Hello,
I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration.
#pwd... (8 Replies)
Hi Friends,
I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only
I can get the... (12 Replies)
Hello ,
I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by
EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt
Contents of... (6 Replies)
So basically I have a log file and each line in this log file starts with a timestamp:
MON DD HH:MM:SS
SEP 15 07:30:01
I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies
LEARN ABOUT BSD
gettimeofday
GETTIMEOFDAY(2) System Calls Manual GETTIMEOFDAY(2)NAME
gettimeofday, settimeofday - get/set date and time
SYNOPSIS
#include <sys/time.h>
gettimeofday(tp, tzp)
struct timeval *tp;
struct timezone *tzp;
settimeofday(tp, tzp)
struct timeval *tp;
struct timezone *tzp;
DESCRIPTION
The system's notion of the current Greenwich time and the current time zone is obtained with the gettimeofday call, and set with the set-
timeofday call. The time is expressed in seconds and microseconds since midnight (0 hour), January 1, 1970. The resolution of the system
clock is hardware dependent, and the time may be updated continuously or in ``ticks.'' If tzp is zero, the time zone information will not
be returned or set.
The structures pointed to by tp and tzp are defined in <sys/time.h> as:
struct timeval {
long tv_sec; /* seconds since Jan. 1, 1970 */
long tv_usec; /* and microseconds */
};
struct timezone {
int tz_minuteswest; /* of Greenwich */
int tz_dsttime; /* type of dst correction to apply */
};
The timezone structure indicates the local time zone (measured in minutes of time westward from Greenwich), and a flag that, if nonzero,
indicates that Daylight Saving time applies locally during the appropriate part of the year.
Only the super-user may set the time of day or time zone.
RETURN
A 0 return value indicates that the call succeeded. A -1 return value indicates an error occurred, and in this case an error code is
stored into the global variable errno.
ERRORS
The following error codes may be set in errno:
[EFAULT] An argument address referenced invalid memory.
[EPERM] A user other than the super-user attempted to set the time.
SEE ALSO date(1), adjtime(2), ctime(3), timed(8)4th Berkeley Distribution May 14, 1986 GETTIMEOFDAY(2)