The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Compare date from db2 table to yesterday's Unix system date sasaliasim Shell Programming and Scripting 9 3 Days Ago 08:37 PM
Perl: Extracting date from file name and comparing with current date MKNENI Shell Programming and Scripting 4 03-26-2008 01:01 PM
date issue-find prevoius date in a patricular format bsandeep_80 UNIX for Advanced & Expert Users 3 11-15-2007 05:42 PM
Changing Creation Date to a Prespecified Date of a File In Unix monkfan UNIX for Dummies Questions & Answers 4 11-28-2006 04:15 AM
a simple way of converting a date in seconds to normal date travian HP-UX 2 11-23-2006 09:25 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-20-2006
Registered User
 

Join Date: Aug 2003
Location: Ireland
Posts: 269
GNU Date

I know there are some posts on getting the time with milliseconds included and I realize unix may not be the best on this.

I have seem some posts where its advised to install the GNU date.
Any one know where I can download this as I am struggling to find it.

Alternatively - if you have anther utility that can do this on unix - let me know... I dont know C code so would prefer to stay away from that if possible
Reply With Quote
Forum Sponsor
  #2  
Old 12-20-2006
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
what is your OS ?
On solaris I have it with miliseconds included :
Code:
[root@t1000-1 /]# time

real    0m0.000s
user    0m0.000s
sys     0m0.000s
Reply With Quote
  #3  
Old 12-20-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
I think he means date, not the time command.


Got perl?
Code:
perldoc -f time
time::HiRes supports milliseconds (get it from CPAN) and you can use the syscall interface to call gettimeofday.
Reply With Quote
  #4  
Old 12-20-2006
Registered User
 

Join Date: Aug 2003
Location: Ireland
Posts: 269
I am running Solaris 9 x86

bash-2.05$ uname -a
SunOS xxxxxxx 5.9 Generic_118559-09 i86pc i386 i86pc
bash-2.05$ time
bash: syntax error near unexpected token `time'


I have perl installed - can I call the time module from command line to get current time with milliseconds?

ie... can I type 'perl -f time' or something like this to get current time?
Reply With Quote
  #5  
Old 12-20-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
This thread shows how to do it in C (in case you decide that C is ok after all)
Reply With Quote
  #6  
Old 12-21-2006
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
I had this issue few days ago, and I thought that the man pages are erroneous...
the "time" that you are trying to invoke is bash built-in command, but different from /usr/bin/time.
Please do "which time" and call the absolute path, I hope this helps.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0