Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

time(3) [ultrix man page]

time(3) 						     Library Functions Manual							   time(3)

Name
       time, ftime - get date and time

Syntax
       #include <time.h>

       time_t time((time_t *)0)

       time_t time(tloc)
       time_t *tloc;

       #include <sys/timeb.h>

       void ftime(tp)
       struct timeb *tp;

Description
       The subroutine returns the time since 00:00:00 GMT, Jan. 1, 1970, measured in seconds.

       If tloc is nonnull, the return value is also stored in the place to which tloc points.

       The entry fills in a structure pointed to by its argument, as defined by <sys/timeb.h>:

       struct timeb
       {
	       time_t	time;
	       unsigned short millitm;
	       short	timezone;
	       short	dstflag;
       };

       The structure contains the time since the epoch in seconds, up to 1000 milliseconds of more-precise interval, 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.

See Also
       date(1), gettimeofday(2), settimeofday(2), ctime(3)

																	   time(3)

Check Out this Related Man Page

FTIME(3)						   BSD Library Functions Manual 						  FTIME(3)

NAME
ftime -- get date and time SYNOPSIS
#include <sys/timeb.h> int ftime(struct timeb *tp); DESCRIPTION
This interface is obsoleted by gettimeofday(2). The ftime() routine fills in a structure pointed to by its argument, as defined by <sys/timeb.h>: /* * Structure returned by ftime system call */ struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; The structure contains the time since the epoch, in seconds; up to 1000 milliseconds of more-precise interval; 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. LEGACY SYNOPSIS
#include <sys/types.h> #include <sys/timeb.h> The include file <sys/types.h> is necessary. SEE ALSO
gettimeofday(2), settimeofday(2), ctime(3), time(3), compat(5) HISTORY
The ftime function appeared in 4.2BSD. BSD
June 4, 1993 BSD
Man Page

11 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying files with the latest date

Hi All, I have a situation where I need to copy the files having the latest date. For example I have a file by name bas100e1_jun05. I need to copy it to bas100e1. But when a file by name bas100e1_jul05 is put in the same directory the script should copy the file having the latest month which... (34 Replies)
Discussion started by: shashi_kiran_v
34 Replies

2. Shell Programming and Scripting

finding idle time of a process

Matez, I have a list of process id's in a text file. I want to know how to find the idle time of a process which are more than 300secs and kill them accordingly. Could you please help me to get these details. I want to write a shell script with this. Thanks..Krish :) (36 Replies)
Discussion started by: Krrishv
36 Replies

3. UNIX for Advanced & Expert Users

Deletion of Logs

Can someone suggest on this script : let's say the logs files are available for Jan 07, Dec 06, Nov 06, Oct 06 the script should identify the latest months logs, i.e Jan 07 it should then delete anything older than 2 months, which will be logs for Nov 06 & Oct 06. (40 Replies)
Discussion started by: srirams
40 Replies

4. UNIX for Dummies Questions & Answers

Copy all the files with time stamp and remove header,trailer from file

All, I am new to unix and i have the following requirement. I have file(s) landing into input directory with timestamp, first i want to copy all these files into seperate directory then i want to rename these files without timestamp and also remove header,trailer from that file.. Could... (35 Replies)
Discussion started by: ksrams
35 Replies

5. Shell Programming and Scripting

automate sftp using unix script

Hi All, I need to write a UNIX script that automates the sftp process. I should be able to do a sftp to a secure box and get a file from there. I am having a problem doing this because no matter what I do, when I run my script, I get a prompt at command line asking for a password. How could I... (34 Replies)
Discussion started by: priyamurthy2005
34 Replies

6. IP Networking

Automated FTP task

Every day i ftp tar.gz a file from the production server to a back up machine.. This task creates way to much traffic on the network at the end of the day and puts and undo load on the production machine during operation hours. i would like to create a script that would automatically fire off the... (36 Replies)
Discussion started by: LowOrderBit
36 Replies

7. What is on Your Mind?

How Much Vacation Do You Take Every Year?

Please vote and comment: How much vacation from work do you take every year? (40 Replies)
Discussion started by: Neo
40 Replies

8. What is on Your Mind?

Where did you meet UNIX for a first time?

Simple question , where did you meet UNIX OS-es. I started with linux, and then I have meet Solaris and I am all in Solaris right now , almost a year that I am in UNIX, still reading manuals. (35 Replies)
Discussion started by: solaris_user
35 Replies

9. UNIX for Dummies Questions & Answers

How to pick only the latest files based on the timestamp?

I have a few log files which get generated on a daily basis..So, I need to pick only the ones which get generated for that particular day. -rw-r--r-- 1 staff 510732676 Apr 7 22:01 test.log040711 -rwxrwxrwx 1 staff 2147482545 Apr 7 21:30 test.log.2 -rwxrwxrwx 1 staff 2147482581 Apr 7 19:26... (43 Replies)
Discussion started by: win4luv
43 Replies

10. Shell Programming and Scripting

Need Time Stamp Range On Log Files

I have created this script #!/bin/sh FILES=/data/log/access_*.log for f in $FILES do echo "Processing $f file" cat $f | awk '{print $1}' | sort | uniq -c | sort -n | tail done It produces this output Processing /data/log/access_abc.log file 114 1.1.1.1 167 2.2.2.2 ... (38 Replies)
Discussion started by: sharingsunshine
38 Replies

11. UNIX for Beginners Questions & Answers

Keep only the closet match of timestamped row (include headers) from file1 to precede file2 row/s

My original files are like this below and I distinguish them from the AP_ID (file1 has 572 and file2 has 544). Also, the header on file1 has “G_” pre-pended. NOTE: these are only snippets of very large files and much of the data is not present here. Original File 1: ... (36 Replies)
Discussion started by: aachave1
36 Replies