- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to use fime( )
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 05:22 PM
01-27-2004 05:22 PM
but , i don't know how to use..
do i make C program?
please help me...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 05:58 PM
01-27-2004 05:58 PM
Re: how to use fime( )
ftime() fills in a structure pointed to by its argument, as defined by
/*
* Structure returned by ftime system call
*/
struct timeb {
time_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 06:38 PM
01-27-2004 06:38 PM
SolutionBelow is a simple program to give you number of seconds since January 1st , 1970
#include
main()
{
struct timeb mytime;
ftime(&mytime);
printf ("time in seconds since epoch is %d\n", mytime.time);
}
Look at the man page of ftime to get more information. There are three other members in this structure that you can use.
Remember time() is to be used instead of ftime() as it is for backward compatibility for older systems.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2004 01:09 AM
01-28-2004 01:09 AM
Re: how to use fime( )
#!/usr/bin/perl -w
my $seconds = time();
printf ("Epoch Seconds = %d\n",$seconds);
my($sec,$min,$hour,$mon,$year,$wday,$yday,$isdst) = localtime($seconds);
$year += 1900;
$mon += 1;
printf("Sec: %d Min: %d Hr: %d Month: %d\n",
$sec,$min,$hour,$mon);
printf("Yr: %d Wk Day: %d Yr Day: %d Is Dst? %d\n",
$year,$wday,$yday,$isdst);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2004 02:42 PM
01-28-2004 02:42 PM
Re: how to use fime( )
thanks in advance!