LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-27-2012, 01:12 PM   #1
whatisit
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
Post current time in milliseconds with "date"?


How can you display current time using options on date?
 
Old 10-27-2012, 01:46 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,339

Rep: Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448Reputation: 1448
The "%N" format string gives you the fractional part in nanoseconds (9 digits, with leading zeros as appropriate). Truncating that to milliseconds is trivial. Rounding to milliseconds is a bit more interesting, but still not difficult.
 
  


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
"How to rename files with current date stamp appended into name using shell script?" nandi Linux - Newbie 4 10-05-2011 10:36 AM
".config" and ".kde" folders are being created under root directory (Slack Current) piratesmack Slackware 8 03-12-2011 11:06 PM
Current time in milliseconds charubcl Linux - Newbie 2 08-08-2008 05:28 AM
"adjust date & time" in KDE on slack 9.1 causes crash mep]-[isto Slackware 13 02-08-2004 10:07 AM
Monthly Archiving Script... help with "date" & "cron" Supp0rtLinux Linux - Software 3 01-03-2003 09:29 PM


All times are GMT -5. The time now is 04:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration