LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-17-2007, 05:56 AM   #1
ruj.sabya
LQ Newbie
 
Registered: Mar 2007
Posts: 16

Rep: Reputation: 0
Current timestamp by reading a file


How can I get the current system time by reading a file (like something from /proc)?

I do not want to open a remote shell. I just want to use sftp subsystem only.

Sabyasachi.
 
Old 04-17-2007, 06:38 AM   #2
hepburnenthorpe
Member
 
Registered: Jun 2006
Location: Sydney
Distribution: Gentoo + Debian
Posts: 132

Rep: Reputation: 15
There is no such file within /proc as far as I can tell.
 
Old 04-17-2007, 07:36 AM   #3
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
In my 2.6.18.8 kernel there is
Code:
root@babylon5:~>cat /proc/driver/rtc 
rtc_time        : 09:34:13
rtc_date        : 2007-04-17
rtc_epoch       : 1900
alarm           : 07:50:00
DST_enable      : no
BCD             : yes
24hr            : yes
....
but I am unsure if it is a standard interface you can count on for a long term project. Anyway...
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Subversion timestamp in file darkarcon2015 Linux - Software 1 05-17-2006 07:45 PM
How to get the timestamp of a file? operand Linux - Newbie 7 01-20-2006 04:14 AM
Insert date and timestamp Into File name petenyce Linux - Newbie 9 10-13-2005 12:16 PM
Timestamp of file/directories Ephracis Linux - Software 1 12-16-2004 09:21 AM
add timestamp to name of file how? supafly Linux - General 3 11-14-2001 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:01 PM.

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