FTIME(3) Linux Programmer's Manual FTIME(3)NAME
ftime - return date and time
SYNOPSIS
#include <sys/timeb.h>
int ftime(struct timeb *tp);
DESCRIPTION
Return current date and time in tp, which is declared as follows:
struct timeb {
time_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
Here time is the number of seconds since the epoch, millitm is the number of milliseconds since time seconds since the epoch, timezone is
the local time zone measured in minutes of time west of Greenwich, and dstflag is a flag that, if nonzero, indicates that Daylight Saving
time applies locally during the appropriate part of the year.
These days the contents of the timezone and dstflag fields are undefined.
RETURN VALUE
This function always returns 0.
BUGS
This function is obsolete. Don't use it. If the time in seconds suffices, time(2) can be used; gettimeofday(2) gives microseconds;
clock_gettime(3) gives nanoseconds but is not yet widely available.
Under libc4 and libc5 the millitm field is meaningful. But early glibc2 is buggy and returns 0 there; glibc 2.1.1 is correct again.
HISTORY
The ftime() function appeared in 4.2BSD.
CONFORMING TO
BSD 4.2, POSIX 1003.1-2001.
SEE ALSO gettimeofday(2), time(2)Linux 2001-12-14 FTIME(3)
Check Out this Related Man Page
FTIME(3) Linux Programmer's Manual FTIME(3)NAME
ftime - return date and time
SYNOPSIS
#include <sys/timeb.h>
int ftime(struct timeb *tp);
DESCRIPTION
This function returns the current time as seconds and milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). The time is returned
in tp, which is declared as follows:
struct timeb {
time_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
Here time is the number of seconds since the Epoch, and millitm is the number of milliseconds since time seconds since the Epoch. The
timezone field is the local timezone measured in minutes of time west of Greenwich (with a negative value indicating minutes east of Green-
wich). The dstflag field is a flag that, if nonzero, indicates that Daylight Saving time applies locally during the appropriate part of
the year.
POSIX.1-2001 says that the contents of the timezone and dstflag fields are unspecified; avoid relying on them.
RETURN VALUE
This function always returns 0. (POSIX.1-2001 specifies, and some systems document, a -1 error return.)
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+----------+---------------+---------+
|Interface | Attribute | Value |
+----------+---------------+---------+
|ftime() | Thread safety | MT-Safe |
+----------+---------------+---------+
CONFORMING TO
4.2BSD, POSIX.1-2001. POSIX.1-2008 removes the specification of ftime().
This function is obsolete. Don't use it. If the time in seconds suffices, time(2) can be used; gettimeofday(2) gives microseconds;
clock_gettime(2) gives nanoseconds but is not as widely available.
BUGS
Early glibc2 is buggy and returns 0 in the millitm field; glibc 2.1.1 is correct again.
SEE ALSO gettimeofday(2), time(2)COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
GNU 2017-09-15 FTIME(3)
I have Java 1.4.2 (IBM AIX build ca142-20050929a SR3) installed on AIX 5.3.
My system time is set correctly and both date and smitty confirm the correct date, time, and timezone:
#date
Thu Sep 21 15:12:42 EDT 2006
However, when I check the sytem time in Java... (2 Replies)
It is required to calculate time difference in seconds between epoch time (19700101 00:00:00) and any given date time (e.g. 20010214 14:30:30).
Is there any command in unix to get it? Thanks in adv. (1 Reply)
Hi Gurus,
I have shell script in which i have to check if time is between to possible value or not. For that i am using following line of code
if
then
echo 'Found In Between'
echo $ftime
... (5 Replies)
Hi,
i need to convert below date/time format into epoch time
YYYY-m-d H:M
below the example:
a=`date +"%F %H:%M"`
echo $a
Convert $a to epoch time
------------------------------------------------------------------------
lets take an example
if $a=1.03
here i want the epoch time... (3 Replies)
Hi folks,
I would like to read the start date and end date of the Daylight Saving Time for the given timezone in the given year. What's the function in C/C++ to read the start of the Daylight Saving date and end of Daylight saving date?
I'm using Linux 2.6.xx Kernel.
For Example, in... (4 Replies)
How do i find the record which has been edit the last 10 minutes?
from a.txt which has last field is epoch time updated.
10/17/2012 1:47 PM||||||In Use|chicken||1350005487
10/17/2012 2:53 PM||||||Available|chicken||13500000
10/17/2012 3:20 PM||||||In Use|cat||1351000000
10/17/2012 3:22... (2 Replies)
Hello,
I have a file with below contents and need to set seconds value to 00 (as you can see few time stamps are with 01 seconds)
18:16:00 8192 7301 89 11
18:21:00 8192 7305 89 11
18:26:00 8192 7306 89 11
18:31:00 8192 7306 ... (6 Replies)
I have time in a file in HH:MM:SS format as it contents(its not the file creation time). i need this to be converted to epoch time or time since 1970. The time is written into that file by a script, which i cannot modify. Im using AIX machine
$ cat abc.txt
10:29:34 (2 Replies)