Sponsored Content
Top Forums Shell Programming and Scripting problem with displaying date and adding time Post 302245317 by FuncMx on Thursday 9th of October 2008 11:54:17 PM
Old 10-10-2008
problem with displaying date and adding time

Hi,
I have a log file with contents like

81.49.74.131 - - [14/Sep/2008:07:19:55 +1000]
81.49.74.131 - - [14/Sep/2008:07:25:55 +1000]
116.112.52.31 - - [15/Sep/2008:07:28:36 +1000]
116.112.52.31 - - [15/Sep/2008:07:28:37 +1000]

I need an output like this
81.49.74.131 14/Sep/2008 Time duration: 00:06:00
116.112.52.31 15/Sep/2008 Time duration: 00:00:01

Please anyone suggest a script for this.

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Adding date and time to a log file

Morning all Im hoping you can help me. We have a nice new oracle server :( and are needing to move some files around for EDI and BACS. The server runs windows but has an app called MKS toolkit installed which give unix commands. (Needed for the oracle stuff) I have had a go using dos commands... (2 Replies)
Discussion started by: ltodd2
2 Replies

2. UNIX for Dummies Questions & Answers

Adding Date & time stamps to filename

I need to edit the file name with date and time while writing the script. please help. (1 Reply)
Discussion started by: manish.s
1 Replies

3. Shell Programming and Scripting

Date time problem

Hi Guys, I have a file a.txt Start Date/Time End Date/Time from Prob_Dura. ----------------- ----------------- ----- ------ 20090525 23:58:59 20090526 00:00:00 machine1 000051 20090525 23:58:09 20090526 00:00:11 machine2 000150 The perl or shell script can: 1. remove... (4 Replies)
Discussion started by: jimmy_y
4 Replies

4. Programming

Date time problem while executing perl script.

Hi All, This Monday 15th March 2010, i have faced a weired issue with my Perl script execution, this script is scheduled to run at 1 minute past midnight on daily basis ( 00:01 EST ) generally for fetching previous business date , say if it is Monday it should give last Friday date, for Tuesday... (0 Replies)
Discussion started by: ravimishra
0 Replies

5. Shell Programming and Scripting

Adding date and time to file name

Hi All, i wanted to add date and time to the file names in the same directory so lets say a file in the directory is test.txt then after running the shell script it should be test-15-11-2010.txt. So I used the following script which works, #!/bin/bash thetime=`date +%Y-%m-%d--%H:%M:%S`... (7 Replies)
Discussion started by: cc_at_work
7 Replies

6. UNIX for Dummies Questions & Answers

Adding hours and minutes to current date (Only to date not to time)

Hi, I want to add some hours and minutes to the current date. For example, if the current date is "July 16, 2012 15:20", i want to add 5 hours 30 minutes to "July 16, 2012 00:00" not to "July 16, 2012 15:20". Please help. Thanks! (4 Replies)
Discussion started by: manojgarg
4 Replies

7. Shell Programming and Scripting

Adding time to date time in UNIX shell scipting

I needed some help in adding a duration (in seconds) to a start time (in hhmmss format) and a start date (in mmddyy format) in order to get an end date and end time. The concept of a leap year is also to be considered while incrementing the day. The code/ function that I have formed so far is as... (3 Replies)
Discussion started by: codehelp04
3 Replies

8. Shell Programming and Scripting

Displaying current date time of EDT in IST time

Hi Folks, My server time is in EDT. And i am sending automated mails from that server in which i need to display the current date time as per IST (GMT+5:30). Please advice how to display the date time as per IST. IST time leads 9:30 mins to EDT. and i wrote something like below. ... (6 Replies)
Discussion started by: Showdown
6 Replies

9. UNIX for Advanced & Expert Users

Problem with adding date

Hi All, Please let me know the error in the below code. m=(0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) M=$(date +%m) Y=$(date +%Y) if ; then M=01 Y=$(($Y+1)) else M=$M+1)printf "01-%s-%d\n" ${m} $Y fi Log: + m=(0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) ++... (4 Replies)
Discussion started by: kiranparsha
4 Replies

10. Shell Programming and Scripting

Adding user name to file, and then displaying new line number

Hi all - I'm completely stumped by a script I'm working on... The short version is I have a file called 'lookup' and in it are hundreds of names (first and last). I have a script that basically allows the user to enter a name, and what I need to have happen is something like this: Record... (8 Replies)
Discussion started by: sabster
8 Replies
DateTime::Locale::af(3) 				User Contributed Perl Documentation				   DateTime::Locale::af(3)

NAME
DateTime::Locale::af SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'af' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Afrikaans. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) Maandag Dinsdag Woensdag Donderdag Vrydag Saterdag Sondag Abbreviated (format) Ma Di Wo Do Vr Sa So Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) Maandag Dinsdag Woensdag Donderdag Vrydag Saterdag Sondag Abbreviated (stand-alone) Ma Di Wo Do Vr Sa So Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) Januarie Februarie Maart April Mei Junie Julie Augustus September Oktober November Desember Abbreviated (format) Jan Feb Mar Apr Mei Jun Jul Aug Sep Okt Nov Des Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) Januarie Februarie Maart April Mei Junie Julie Augustus September Oktober November Desember Abbreviated (stand-alone) Jan Feb Mar Apr Mei Jun Jul Aug Sep Okt Nov Des Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) 1ste kwartaal 2de kwartaal 3de kwartaal 4de kwartaal Abbreviated (format) K1 K2 K3 K4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1ste kwartaal 2de kwartaal 3de kwartaal 4de kwartaal Abbreviated (stand-alone) K1 K2 K3 K4 Narrow (stand-alone) 1 2 3 4 Eras Wide voor Christus na Christus Abbreviated v.C. n.C. Narrow v.C. n.C. Date Formats Full 2008-02-05T18:30:30 = Dinsdag 05 Februarie 2008 1995-12-22T09:05:02 = Vrydag 22 Desember 1995 -0010-09-15T04:44:23 = Saterdag 15 September -10 Long 2008-02-05T18:30:30 = 05 Februarie 2008 1995-12-22T09:05:02 = 22 Desember 1995 -0010-09-15T04:44:23 = 15 September -10 Medium 2008-02-05T18:30:30 = 05 Feb 2008 1995-12-22T09:05:02 = 22 Des 1995 -0010-09-15T04:44:23 = 15 Sep -10 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 = 05 Feb 2008 1995-12-22T09:05:02 = 22 Des 1995 -0010-09-15T04:44:23 = 15 Sep -10 Time Formats Full 2008-02-05T18:30:30 = 6:30:30 nm. UTC 1995-12-22T09:05:02 = 9:05:02 vm. UTC -0010-09-15T04:44:23 = 4:44:23 vm. UTC Long 2008-02-05T18:30:30 = 6:30:30 nm. UTC 1995-12-22T09:05:02 = 9:05:02 vm. UTC -0010-09-15T04:44:23 = 4:44:23 vm. UTC Medium 2008-02-05T18:30:30 = 6:30:30 nm. 1995-12-22T09:05:02 = 9:05:02 vm. -0010-09-15T04:44:23 = 4:44:23 vm. Short 2008-02-05T18:30:30 = 6:30 nm. 1995-12-22T09:05:02 = 9:05 vm. -0010-09-15T04:44:23 = 4:44 vm. Default 2008-02-05T18:30:30 = 6:30:30 nm. 1995-12-22T09:05:02 = 9:05:02 vm. -0010-09-15T04:44:23 = 4:44:23 vm. Datetime Formats Full 2008-02-05T18:30:30 = Dinsdag 05 Februarie 2008 6:30:30 nm. UTC 1995-12-22T09:05:02 = Vrydag 22 Desember 1995 9:05:02 vm. UTC -0010-09-15T04:44:23 = Saterdag 15 September -10 4:44:23 vm. UTC Long 2008-02-05T18:30:30 = 05 Februarie 2008 6:30:30 nm. UTC 1995-12-22T09:05:02 = 22 Desember 1995 9:05:02 vm. UTC -0010-09-15T04:44:23 = 15 September -10 4:44:23 vm. UTC Medium 2008-02-05T18:30:30 = 05 Feb 2008 6:30:30 nm. 1995-12-22T09:05:02 = 22 Des 1995 9:05:02 vm. -0010-09-15T04:44:23 = 15 Sep -10 4:44:23 vm. Short 2008-02-05T18:30:30 = 2008/02/05 6:30 nm. 1995-12-22T09:05:02 = 1995/12/22 9:05 vm. -0010-09-15T04:44:23 = -010/09/15 4:44 vm. Default 2008-02-05T18:30:30 = 05 Feb 2008 6:30:30 nm. 1995-12-22T09:05:02 = 22 Des 1995 9:05:02 vm. -0010-09-15T04:44:23 = 15 Sep -10 4:44:23 vm. 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 Di 1995-12-22T09:05:02 = 22 Vr -0010-09-15T04:44:23 = 15 Sa 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 nm. 1995-12-22T09:05:02 = 9:05 vm. -0010-09-15T04:44:23 = 4:44 vm. 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 nm. 1995-12-22T09:05:02 = 9:05:02 vm. -0010-09-15T04:44:23 = 4:44:23 vm. 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 = Di, 2-5 1995-12-22T09:05:02 = Vr, 12-22 -0010-09-15T04:44:23 = Sa, 9-15 MMdd (MM/dd) 2008-02-05T18:30:30 = 02/05 1995-12-22T09:05:02 = 12/22 -0010-09-15T04:44:23 = 09/15 MMM (LLL) 2008-02-05T18:30:30 = Feb 1995-12-22T09:05:02 = Des -0010-09-15T04:44:23 = Sep MMMd (MMM d) 2008-02-05T18:30:30 = Feb 5 1995-12-22T09:05:02 = Des 22 -0010-09-15T04:44:23 = Sep 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = Di Feb 5 1995-12-22T09:05:02 = Vr Des 22 -0010-09-15T04:44:23 = Sa Sep 15 MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 Februarie 1995-12-22T09:05:02 = 22 Desember -0010-09-15T04:44:23 = 15 September MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 Februarie 1995-12-22T09:05:02 = 22 Desember -0010-09-15T04:44:23 = 15 September MMMMEd (E MMMM d) 2008-02-05T18:30:30 = Di Februarie 5 1995-12-22T09:05:02 = Vr Desember 22 -0010-09-15T04:44:23 = Sa September 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 = Di, 2008-2-5 1995-12-22T09:05:02 = Vr, 1995-12-22 -0010-09-15T04:44:23 = Sa, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 Feb 1995-12-22T09:05:02 = 1995 Des -0010-09-15T04:44:23 = -10 Sep yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = Di, 2008 Feb 5 1995-12-22T09:05:02 = Vr, 1995 Des 22 -0010-09-15T04:44:23 = Sa, -10 Sep 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 Februarie 1995-12-22T09:05:02 = 1995 Desember -0010-09-15T04:44:23 = -10 September 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 K1 1995-12-22T09:05:02 = 1995 K4 -0010-09-15T04:44:23 = -10 K3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMM (yyyy/MM) 2008-02-05T18:30:30 = 2008/02 1995-12-22T09:05:02 = 1995/12 -0010-09-15T04:44:23 = -010/09 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = Februarie 2008 1995-12-22T09:05:02 = Desember 1995 -0010-09-15T04:44:23 = September -10 Miscellaneous Prefers 24 hour time? No Local first day of the week Maandag 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.16.2 2013-08-25 DateTime::Locale::af(3)
All times are GMT -4. The time now is 07:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy