TIME(3C)TIME(3C)NAME
time, ftime - get date and time
SYNOPSIS
long time(0)
long time(tloc)
long *tloc;
#include <sys/types.h>
#include <sys/timeb.h>
ftime(tp)
struct timeb *tp;
DESCRIPTION
These interfaces are obsoleted by gettimeofday(2).
Time 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 ftime entry fills in a structure pointed to by its argument, as defined by <sys/timeb.h>:
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)4th Berkeley Distribution May 9, 1985 TIME(3C)
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
Strange behaviour of the strftime() function from gawk (3.1.5):
$ awk 'BEGIN{print strftime("%T", 3600)}'
> 02:00:00
$ awk 'BEGIN{print strftime("%T", 0)}'
> 01:00:00
Obviously something with DST but I can not figure out why? To me 3600 epoch seconds remains 01:00, DST or not.
From... (2 Replies)
Hi Everyone
i have a perl file below, one of the line is convert the pcho time to human readable format.
$value=`awk 'BEGIN{print strftime("%c",1273236600)}' | tr -d '\n'`;
if image, if i have lots of pcho time value in a file, if i use this awk, strftime, then tr -d to remove the \n,... (2 Replies)
Hi,
I'm wrote a small program on HPUX that uses wcsftime, but this function seems to be not working - I get 0 as a result, the output buffer returns empty, and errno is 0 :
#include <iostream>
using namespace std;
int main ()
{
size_t formattedTimeLength = 0;
wchar_t formattedTime... (9 Replies)
Hi,
I am facing one strange situation while using strftime() to get current date and time in C.
it leaks memory with %T
strftime(L_StrDate,30,"%d-%b-%C%y %T", localtime((time_t *)&tv.tv_sec)) ;
and when i use another option then no memory leak like
strftime(L_StrDate,30,"%d-%b-%C%y ... (3 Replies)
HI,
i wish to convert a millsec value to a readable string format.
the one option is to use strftime.
However this is a bit costly (1-5 micros).
is there a a faster way to do so with just string manipulation
(Note i have the date object which has the time details but wish o avoid strftime) (2 Replies)
Hello all,
I have the following code that seems to be misbehaving depending on the timezone setting (TZ Environment variable). It gives the correct value when TZ is in POSIX format and the wrong value when in OLSON format.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include... (6 Replies)
I frequently use awk time functions and am switching some scripts over to mawk. I don't have the mktime or strftime functions in mawk, but it appears that there is a way, as explained here in "Time functions":
Please only cut-and-past links to man pages from our man pages.
So, simple... (10 Replies)
I'm trying to use AWK to filter on some dates in a field by converting them to Unix Time.
mktime(strftime(format,"6-FEB-2013 08:50:03.841")What is the proper format for my date strings as they appear in my database?
My first thought is %d-%b-%Y %H:%M:%Sbut I see the following issues:
%d is... (3 Replies)
I am using Sun OS 5.10
I am Using nawk to extract specific column from csv file.
The third column of csv is the time in Milliseconds and I need to convert it to Date then save it in another csv file.
I am use this command to extract the columns I need and save it in tttn.csv
nawk 'BEGIN... (6 Replies)