Sponsored Content
Top Forums Shell Programming and Scripting Getting a relative timestamp from timestamp stored in a file Post 302517553 by 116@434 on Wednesday 27th of April 2011 06:08:21 AM
Old 04-27-2011
Try this awk script:

Code:
{ split($2, t, ":")
  ts = t[1]*3600+t[2]*60+t[3]
  if (NR == 1) ots = ts
  print $0, ts - ots
}

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

timestamp of file

Hi, I need to recursively find alll files generated as of today. I was able to use find and ls -l to do that but the problem i am facing is there are around 48000 subdirectories it needs to search in. Any help is appreciated. krisdhar (4 Replies)
Discussion started by: krisdhar
4 Replies

2. UNIX for Dummies Questions & Answers

File timestamp

Hi, Could someone please tell me how to find the last modified date (date,hours,minutes,seconds) of a file in the format YYYY-MM-DD hh:mm:ss of a file using only standard HP-UX commands? I looked for options in "ls" command but I couldn't find any options for HP-UX which gets the date details... (4 Replies)
Discussion started by: stevefox
4 Replies

3. Shell Programming and Scripting

conversion of different timestamp to standard timestamp

hi i need a scrit to convert one date format to another. for example i have three columns in a file which gets a different format, but lastly i want output with stadard timestamp as "yyyy-mm-dd hh:mm:ss" column1 column2 ... (2 Replies)
Discussion started by: dprakash
2 Replies

4. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

5. Shell Programming and Scripting

Check if a date field has date or timestamp or date&timestamp

Hi, In a field, I should receive the date with time stamp in a particular field. But sometimes the vendor sends just the date or the timestamp or correctl the date&timestamp. I have to figure out the the data is a date or time stamp or date&timestamp. If it is date then append "<space>00:00:00"... (1 Reply)
Discussion started by: machomaddy
1 Replies

6. Shell Programming and Scripting

Identifying files with a timestamp greater than a given timestamp

I need to be able to identify files with file timestamps greater than a given timestamp. I am using the following solution, although it appears to compare files at the "seconds" granularity and I need it at the milliseconds. When I tested my solution, it missed files that had timestamps... (3 Replies)
Discussion started by: nkm0brm
3 Replies

7. Shell Programming and Scripting

To get the timestamp of a file

Hi Friends I need to get the tine stamp of a file and based on this time stamp I am doing a comparison and based on this i need to call a java jar file. I am using ksh shell and in this stat is not there. So instead of stat I am using ls -l command and using awk i am getting $6 $7 and $8... (2 Replies)
Discussion started by: Kannannair
2 Replies

8. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies

9. Shell Programming and Scripting

AIX : Need to convert UNIX Timestamp to normal timestamp

Hello , I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt Contents of... (6 Replies)
Discussion started by: rahul2662
6 Replies

10. Shell Programming and Scripting

Grep lines between last hour timestamp and current timestamp

So basically I have a log file and each line in this log file starts with a timestamp: MON DD HH:MM:SS SEP 15 07:30:01 I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies
DateTime::Locale::eu_ES(3)				User Contributed Perl Documentation				DateTime::Locale::eu_ES(3)

NAME
DateTime::Locale::eu_ES SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'eu_ES' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Basque Spain. DATA
This locale inherits from the DateTime::Locale::eu locale. It contains the following data. Days Wide (format) astelehena asteartea asteazkena osteguna ostirala larunbata igandea Abbreviated (format) al as az og or lr ig Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) astelehena asteartea asteazkena osteguna ostirala larunbata igandea Abbreviated (stand-alone) al as az og or lr ig Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) urtarrila otsaila martxoa apirila maiatza ekaina uztaila abuztua iraila urria azaroa abendua Abbreviated (format) urt ots mar api mai eka uzt abu ira urr aza abe Narrow (format) U O M A M E U A I U A A Wide (stand-alone) urtarrila otsaila martxoa apirila maiatza ekaina uztaila abuztua iraila urria azaroa abendua Abbreviated (stand-alone) urt ots mar api mai eka uzt abu ira urr aza abe Narrow (stand-alone) U O M A M E U A I U A A Quarters Wide (format) 1. hiruhilekoa 2. hiruhilekoa 3. hiruhilekoa 4. hiruhilekoa Abbreviated (format) 1Hh 2Hh 3Hh 4Hh Narrow (format) 1 2 3 4 Wide (stand-alone) 1. hiruhilekoa 2. hiruhilekoa 3. hiruhilekoa 4. hiruhilekoa Abbreviated (stand-alone) 1Hh 2Hh 3Hh 4Hh Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated BCE CE Narrow BCE CE Date Formats Full 2008-02-05T18:30:30 = asteartea, 2008eko otsailaren 05a 1995-12-22T09:05:02 = ostirala, 1995eko abenduaren 22a -0010-09-15T04:44:23 = larunbata, -10eko irailaren 15a Long 2008-02-05T18:30:30 = 2008eko otsren 05a 1995-12-22T09:05:02 = 1995eko aberen 22a -0010-09-15T04:44:23 = -10eko iraren 15a Medium 2008-02-05T18:30:30 = 2008 ots 5 1995-12-22T09:05:02 = 1995 abe 22 -0010-09-15T04:44:23 = -10 ira 15 Short 2008-02-05T18:30:30 = 2008-02-05 1995-12-22T09:05:02 = 1995-12-22 -0010-09-15T04:44:23 = -010-09-15 Default 2008-02-05T18:30:30 = 2008 ots 5 1995-12-22T09:05:02 = 1995 abe 22 -0010-09-15T04:44:23 = -10 ira 15 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = asteartea, 2008eko otsailaren 05a 18:30:30 UTC 1995-12-22T09:05:02 = ostirala, 1995eko abenduaren 22a 09:05:02 UTC -0010-09-15T04:44:23 = larunbata, -10eko irailaren 15a 04:44:23 UTC Long 2008-02-05T18:30:30 = 2008eko otsren 05a 18:30:30 UTC 1995-12-22T09:05:02 = 1995eko aberen 22a 09:05:02 UTC -0010-09-15T04:44:23 = -10eko iraren 15a 04:44:23 UTC Medium 2008-02-05T18:30:30 = 2008 ots 5 18:30:30 1995-12-22T09:05:02 = 1995 abe 22 09:05:02 -0010-09-15T04:44:23 = -10 ira 15 04:44:23 Short 2008-02-05T18:30:30 = 2008-02-05 18:30 1995-12-22T09:05:02 = 1995-12-22 09:05 -0010-09-15T04:44:23 = -010-09-15 04:44 Default 2008-02-05T18:30:30 = 2008 ots 5 18:30:30 1995-12-22T09:05:02 = 1995 abe 22 09:05:02 -0010-09-15T04:44:23 = -10 ira 15 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 as 1995-12-22T09:05:02 = 22 or -0010-09-15T04:44:23 = 15 lr Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = as, 2-5 1995-12-22T09:05:02 = or, 12-22 -0010-09-15T04:44:23 = lr, 9-15 MMM (LLL) 2008-02-05T18:30:30 = ots 1995-12-22T09:05:02 = abe -0010-09-15T04:44:23 = ira MMMd (MMM d) 2008-02-05T18:30:30 = ots 5 1995-12-22T09:05:02 = abe 22 -0010-09-15T04:44:23 = ira 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = as ots 5 1995-12-22T09:05:02 = or abe 22 -0010-09-15T04:44:23 = lr ira 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = otsaila 5 1995-12-22T09:05:02 = abendua 22 -0010-09-15T04:44:23 = iraila 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = as otsaila 5 1995-12-22T09:05:02 = or abendua 22 -0010-09-15T04:44:23 = lr iraila 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = as, 2008-2-5 1995-12-22T09:05:02 = or, 1995-12-22 -0010-09-15T04:44:23 = lr, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 ots 1995-12-22T09:05:02 = 1995 abe -0010-09-15T04:44:23 = -10 ira yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = as, 2008 ots 5 1995-12-22T09:05:02 = or, 1995 abe 22 -0010-09-15T04:44:23 = lr, -10 ira 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 otsaila 1995-12-22T09:05:02 = 1995 abendua -0010-09-15T04:44:23 = -10 iraila yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 1Hh 1995-12-22T09:05:02 = 1995 4Hh -0010-09-15T04:44:23 = -10 3Hh yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week astelehena SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::eu_ES(3)
All times are GMT -4. The time now is 05:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy