Operating System - HP-UX
1819897 Members
2650 Online
109607 Solutions
New Discussion юеВ

Re: represent 1/1000000 seconds using date command

 
KO kwang tae
Advisor

represent 1/1000000 seconds using date command

hello

how can i represent 1/1000000 seconds using date command?

please help me..

thanks in advance~
4 REPLIES 4
KapilRaj
Honored Contributor

Re: represent 1/1000000 seconds using date command

i can't get ur question

Kaps
Nothing is impossible
KO kwang tae
Advisor

Re: represent 1/1000000 seconds using date command

in other words, using date command option

can you represent the following as

Thu Jul 1 12:43:24.####### KST 2004

can you get my question?
Mei Jiao
Respected Contributor

Re: represent 1/1000000 seconds using date command

I'm not sure if there's a representation of 1/1000000 seconds in 'date' command, but from the 'date' manpage:

%S Second as a two-digit decimal number (allows for possibleleap seconds) [00-61]. For example, 58.

Seems like it's only showing seconds as a two-digit decimal number. Try this command:
# date "+DATE: %m/%d/%y%nTIME: %H:%M:%S"
DATE: 07/01/04
TIME: 15:00:37
Dietmar Konermann
Honored Contributor

Re: represent 1/1000000 seconds using date command

No, the date(1) command uses the time(2) system call to get the current time. Resolution of time(2) is 1 second... so no chance to get micro seconds. To accomplish this you would need to use the gettimeofday(2) syscall. There is a usage example in C contained in the man page.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)