Sponsored Content
Top Forums Shell Programming and Scripting Converting past date to seconds Post 302302331 by synergy_texas on Monday 30th of March 2009 05:18:27 PM
Old 03-30-2009
Not sure what stat is. I am on AIX 5.3 and it does not find stat. I see the stat function in Wikipedia. Not sure why AIX 5.3 does not seem to use it. Any ideas? Perhaps it is part of a utility that is not installed? Found istat, however there are no options to convert to seconds. Your solution is great, however I need an AIX 5.3 compatible solution.

Last edited by synergy_texas; 03-30-2009 at 07:31 PM..
 

10 More Discussions You Might Find Interesting

1. HP-UX

a simple way of converting a date in seconds to normal date

Hi all! I'm working on a HPUX system, and I was wondering if there is a simple way to convert a date from seconds (since 1970) to a normal date. Thanks (2 Replies)
Discussion started by: travian
2 Replies

2. Shell Programming and Scripting

Get date and time for past 1 hour from current date

Hi, I need to get the date and time for past 1 hour from the current date. Anyone know how to do so? Thanks (5 Replies)
Discussion started by: spch2o
5 Replies

3. Shell Programming and Scripting

How to find a date which is 7 days past when given current date

hii all. I have to get the date of the 7th day past from the current date. if i give the current date as sep 3 then i must get the date as 27th of august. can we get the values from the "cal" command. cal | awk '{print $2}' will this type of command work. actually my need is if today is... (17 Replies)
Discussion started by: ladtony
17 Replies

4. Shell Programming and Scripting

Get Previous date of a past date

Hi all, I have a variable where it has a past date value in the format YYYY-MM-DD eg-> pcontromModate="2008-11-31" How can i get the date 1 day before the pcontromModate. The required date is 2008-11-30. ..Plz reply since its an urgent one (2 Replies)
Discussion started by: morbid_angel
2 Replies

5. Shell Programming and Scripting

Converting a date to friday date and finding Min/Max date

Dear all, I have 2 questions. I have a file with many rows which has date of the format YYYYMMDD. 1. I need to change the date to that weeks friday date(Ex: 20120716(monday) to 20120720). Satuday/Sunday has to be changed to next week friday date too. 2. After converting the date to... (10 Replies)
Discussion started by: 2001.arun
10 Replies

6. Linux

date of a specific past day

Can I print the date of a specific date? Let say, today is 20 and I want to print in date format the day 14 I know that I can do this: date --date='last Mon' but How can I do this?: date --date='last 14' ?? (7 Replies)
Discussion started by: kernel_panic
7 Replies

7. Shell Programming and Scripting

Seven days past date from current date

hi all.. i want 2 know how 2 find 7days past date from current date.. when i used set datetime = `date '+%m%d%y'` i got 060613.. i just want to know hw to get 053013.. i tried using date functions but couldnt get it :( i use c shell and there is no chance that i can change that ..... (3 Replies)
Discussion started by: Rahul619
3 Replies

8. Shell Programming and Scripting

Converting seconds to time

I have a list of time spans in seconds, and want to compute the time span as hh:mm:nn I am coding in bash and have coded the following. However, the results are wrong as "%.0f" rounds the values. Example: ftm: 25793.5 tmspan(hrs,min,sec): 7.16 429.89 25793.50 hh: 7 mm: 10 ss:... (2 Replies)
Discussion started by: kristinu
2 Replies

9. Shell Programming and Scripting

Converting time format as Integer to seconds

Hello, How can we convert date like format 20181004171050 in seconds ? I can able to convert till date but failing for HHMMSS. date -d "20181004" "+%s" output as 1538596800 . But when i add hhmmss it is failing date -d "20181004172000" "+%s" result Invalid date Kindly guide. Regards (16 Replies)
Discussion started by: sadique.manzar
16 Replies

10. Shell Programming and Scripting

Converting seconds to minutes

Hello everyone, I calculate in my bash script the different between two timestamps in seconds. The next step would be to get the difference in minutes, and there is my Problem:AnzahlUeberstunden=$(( $(date -d "$JAHR-$MONAT-$TAG $ArbeitEnde" +%s) - $(date -d "$JAHR-$MONAT-$TAG... (6 Replies)
Discussion started by: Chaos_Lord
6 Replies
IO::Async::File(3pm)					User Contributed Perl Documentation				      IO::Async::File(3pm)

NAME
"IO::Async::File" - watch a file for changes SYNOPSIS
use IO::Async::File; use IO::Async::Loop; my $loop = IO::Async::Loop->new; my $file = IO::Async::File->new( filename => "config.ini", on_mtime_changed => sub { my ( $self ) = @_; print STDERR "Config file has changed "; reload_config( $self->handle ); } ); $loop->add( $file ); $loop->run; DESCRIPTION
This subclass of IO::Async::Notifier watches an open filehandle or named filesystem entity for changes in its "stat()" fields. It invokes various events when the values of these fields change. It is most often used to watch a file for size changes; for this task see also IO::Async::FileStream. While called "File", it is not required that the watched filehandle be a regular file. It is possible to watch anything that stat(2) may be called on, such as directories or other filesystem entities. EVENTS
The following events are invoked, either using subclass methods or CODE references in parameters. on_dev_changed $new_dev, $old_dev on_ino_changed $new_ino, $old_ino ... on_ctime_changed $new_ctime, $old_ctime Invoked when each of the individual "stat()" fields have changed. All the "stat()" fields are supported apart from "blocks" and "blksize". Each is passed the new and old values of the field. on_devino_changed $new_stat, $old_stat Invoked when either of the "dev" or "ino" fields have changed. It is passed two File::stat instances containing the complete old and new "stat()" fields. This can be used to observe when a named file is renamed; it will not be observed to happen on opened filehandles. on_stat_changed $new_stat, $old_stat Invoked when any of the "stat()" fields have changed. It is passed two File::stat instances containing the old and new "stat()" fields. PARAMETERS
The following named parameters may be passed to "new" or "configure". handle => IO The opened filehandle to watch for "stat()" changes if "filename" is not supplied. filename => STRING Optional. If supplied, watches the named file rather than the filehandle given in "handle". The file will be opened for reading and then watched for renames. If the file is renamed, the new filename is opened and tracked similarly after closing the previous file. interval => NUM Optional. The interval in seconds to poll the filehandle using stat(2) looking for size changes. A default of 2 seconds will be applied if not defined. METHODS
$handle = $file->handle Returns the filehandle currently associated with the instance; either the one passed to the "handle" parameter, or opened from the "filename" parameter. AUTHOR
Paul Evans <leonerd@leonerd.org.uk> perl v5.14.2 2012-10-24 IO::Async::File(3pm)
All times are GMT -4. The time now is 11:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy