The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
date and time to display on the terminal cesarNZ Shell Programming and Scripting 11 09-05-2007 07:19 PM
a simple way of converting a date in seconds to normal date travian HP-UX 2 11-23-2006 12:25 PM
how to display time in minutes n seconds... santy Shell Programming and Scripting 1 08-23-2006 10:18 AM
display date n Time SsRrIi SUN Solaris 1 03-16-2006 05:48 AM
Script to display last login date/time? ryaneverett5 UNIX for Dummies Questions & Answers 3 12-06-2001 05:21 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-05-2006
me_haroon me_haroon is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 18
Unable to display the date-time in seconds on AIX

Hi,

In unix the command "date +%s" displays the date-time in seconds since â00:00:00 1970-01-01 UTCâ (a GNU extension)
when executed on unix:
-sh-2.05b$ date +%s
1152092690

I tried with all the format control output but unable to display the date-time in seconds i,e as in unix format. Can anybody tell me how to display date-time in seconds on AIX or give me the equivalent command as in unix.

Thanks,
Haroon
  #2 (permalink)  
Old 07-05-2006
jyoung jyoung is offline
Registered User
  
 

Join Date: Nov 2001
Location: Flint, MI
Posts: 227
Try man date. I think you want %S instead of %s.
  #3 (permalink)  
Old 07-10-2006
me_haroon me_haroon is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 18
Hi,

I have tried with all options using man date, but i am not able to display the time on the screen in desired format.
I require date to be displayed in the given format below:

1145470369 - i,e Specifies the time (in seconds) since the epoch (00:00:00 GMT, January 1, 1970).

Thanks,
Haroon
  #4 (permalink)  
Old 07-10-2006
sprellari sprellari is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 49
date +%s works fine for me on my AIX 5.3 machine. What is the output when you give this command?
  #5 (permalink)  
Old 07-10-2006
me_haroon me_haroon is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 18
Hi,

When i tried "date +%s" on my AIX 5.1 , it displays %s .

Thanks,
Haroon

Last edited by me_haroon; 07-11-2006 at 04:08 AM..
  #6 (permalink)  
Old 07-11-2006
me_haroon me_haroon is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 18
Are some alternate commands available

Hi,

The command date +%s is not available for AIX 5.1, but available in AIX 5.3. CAn any one plese tell me some combination of commands that will do the job of date +%s on AIX 5.1.

Its an urgent issue please help me.

Thanks,
Haroon
  #7 (permalink)  
Old 07-11-2006
jyoung jyoung is offline
Registered User
  
 

Join Date: Nov 2001
Location: Flint, MI
Posts: 227
Would perl do?
Code:
 #!/usr/bin/perl
$mytime=time;
print "$mytime\n";
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0