LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-18-2007, 11:45 PM   #1
culin
Member
 
Registered: Sep 2006
Distribution: Fedora Core 10
Posts: 254

Rep: Reputation: 32
system time since 1970


Hi all,
can anyone tell a file from where i can read the system time
(counts of secs. since 1970)......
the file should be something like /proc/uptime which keeps updating every 1 sec.
 
Old 02-19-2007, 12:16 AM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

It's not from a file, but running
Code:
date +%s
should do the trick.

Dave
 
Old 02-19-2007, 12:25 AM   #3
culin
Member
 
Registered: Sep 2006
Distribution: Fedora Core 10
Posts: 254

Original Poster
Rep: Reputation: 32
thanks ilikejam ,
i know this, but is there any such file ?? or can u tell is this funciton gettimeofday() using any file ???
 
Old 02-19-2007, 12:32 AM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
No - there is no such file.

The 32-bit unsigned time value "0" is the "epoch" 12AM Dec 31 1969:

http://www.capmac.org/phpbb2/viewtopic.php?p=3517&
 
Old 02-19-2007, 02:43 AM   #5
culin
Member
 
Registered: Sep 2006
Distribution: Fedora Core 10
Posts: 254

Original Poster
Rep: Reputation: 32
oh....ok... thanks all for the reply...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where does RH8 daily set system time to hardware clock time smartnorman Red Hat 1 05-24-2006 02:42 PM
qms-analog shows date of 1/1/1970 cwwilson721 Linux - Software 0 02-14-2006 03:00 AM
Setting System Time: kernel in wrong time zone warrenweiss Linux - General 7 05-15-2004 03:25 PM
Debian in PA-RISC - System Clock is reset to Jan 1970 at bootup wgpaine Linux - General 2 02-07-2004 10:38 AM
php timestamp problems before 1970 wedgeworth Linux - Software 2 12-09-2003 12:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration