... which means first date 2012/6/24 19:25:55,second date 2012/6/24 20:40:06 so when i get the time difference the answer will be 1:14:11 ...
Like many tasks, this seems easy for perl and the appropriate module, although to the novice it can seem impenetrable. Here is a shell script that calls a perl script to do date arithmetic:
producing:
See man pages for details and local system administrators for aid if installation of perl modules is necessary.
Hello Friends,
I want to write a script for the following:
nlscux62:tibprod> grep "2008 Apr 30 01:" SA_EHV_SPEED_SFC_IN_03-SA_EHV_SPEED_SFC_IN_03-2.log | grep -i post | more
2008 Apr 30 01:01:23:928 GMT +2 SAPAdapter.SA_EHV_SPEED_SFC_IN_03-SA_EHV_SPEED_SFC_IN_03-2 Info AER3-000095 IDOC... (2 Replies)
Hi guru's,
Am new to shell scripting.
I am getting the below o/p from the oracle database, when I fire a query.
ID JOB_ID ELAPSED_TIME FROM TO
----- ------ ------------------- -------- --------
62663 11773 01/06/2009 09:49:13 SA CM
62664 11773 ... (4 Replies)
HI All,
can some one please help me how to fine the difference between two time stamps say
a= Nov 10, 2009 9:21:25 AM
b= Nov 10, 2009 10:21:25 AM
I want to find difference between the a & b
I googled and tried with some options but no luck.
My OS is AIX (1 Reply)
Hi,
START_TIME :- "10-NOV-2009 00:00:04"
STOP_TIME :- "10-NOV-2009 00:05:47"
Please help to find difference between these two.
Searched for the same topic but did not find an answer for the same time format :(
Regards,
Robin (3 Replies)
Hello All,
I have a problem calculating the time difference between start and end timings...!
the timings are given by 24hr format..
Start Date : 08/05/10 12:55
End Date : 08/09/10 06:50
above values are in mm/dd/yy hh:mm format.
Now the thing is, 7th(08/07/10) and... (16 Replies)
Hello
I have a file in following format:
IV 08:09:07
NM 08:12:01
IC 08:12:00
MN 08:14:20
NM 08:14:15
I need a script to compare time on each line with previous line and show the inconsecutive line. Ex.:
08:12:00
08:14:15
A better way... (6 Replies)
I have a file wich contains time formats and i need to get the time difference
TIME1 TIME2
==================================
20120624192555.6Z 20120624204006.5Z
which means first date 2012/6/24 19:25:55,second date 2012/6/24 20:40:06 so when i get the time... (1 Reply)
Hi All,
Firstly thank you for the forum members I need to find time difference b'w two rows of timestamp using awk/shell.
Here is the logfile:
cat business_file
start:skdjh:22:06:2010:10:30:22
sdfnskjoeirg
wregn'wergnoeirnfqoeitgherg
end:siifneworigo:22:06:2010:10:45:34... (3 Replies)
Hi,
I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log.
Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)
Hello,
In HP-UX how to find the date time difference ?
Start time: 28-APR-2019 21:36:01
End time : 29-APR-2019 00:36:04
----------------------
Difference is
----------------------
Much appreciate any pointer or view on this.
... (3 Replies)
Discussion started by: Siva SQL
3 Replies
LEARN ABOUT DEBIAN
template::plugin::date
Template::Plugin::Date(3pm) User Contributed Perl Documentation Template::Plugin::Date(3pm)NAME
Template::Plugin::Date - Plugin to generate formatted date strings
SYNOPSIS
[% USE date %]
# use current time and default format
[% date.format %]
# specify time as seconds since epoch
# or as a 'h:m:s d-m-y' or 'y-m-d h:m:s' string
[% date.format(960973980) %]
[% date.format('4:20:36 21/12/2000') %]
[% date.format('2000/12/21 4:20:36') %]
# specify format
[% date.format(mytime, '%H:%M:%S') %]
# specify locale
[% date.format(date.now, '%a %d %b %y', 'en_GB') %]
# named parameters
[% date.format(mytime, format = '%H:%M:%S') %]
[% date.format(locale = 'en_GB') %]
[% date.format(time = date.now,
format = '%H:%M:%S',
locale = 'en_GB) %]
# specify default format to plugin
[% USE date(format = '%H:%M:%S', locale = 'de_DE') %]
[% date.format %]
...
DESCRIPTION
The "Date" plugin provides an easy way to generate formatted time and date strings by delegating to the "POSIX" "strftime()" routine.
The plugin can be loaded via the familiar USE directive.
[% USE date %]
This creates a plugin object with the default name of '"date"'. An alternate name can be specified as such:
[% USE myname = date %]
The plugin provides the "format()" method which accepts a time value, a format string and a locale name. All of these parameters are
optional with the current system time, default format ('"%H:%M:%S %d-%b-%Y"') and current locale being used respectively, if undefined.
Default values for the time, format and/or locale may be specified as named parameters in the "USE" directive.
[% USE date(format = '%a %d-%b-%Y', locale = 'fr_FR') %]
When called without any parameters, the "format()" method returns a string representing the current system time, formatted by "strftime()"
according to the default format and for the default locale (which may not be the current one, if locale is set in the "USE" directive).
[% date.format %]
The plugin allows a time/date to be specified as seconds since the epoch, as is returned by "time()".
File last modified: [% date.format(filemod_time) %]
The time/date can also be specified as a string of the form "h:m:s d/m/y" or "y/m/d h:m:s". Any of the characters : / - or space may be
used to delimit fields.
[% USE day = date(format => '%A', locale => 'en_GB') %]
[% day.format('4:20:00 9-13-2000') %]
Output:
Tuesday
A format string can also be passed to the "format()" method, and a locale specification may follow that.
[% date.format(filemod, '%d-%b-%Y') %]
[% date.format(filemod, '%d-%b-%Y', 'en_GB') %]
A fourth parameter allows you to force output in GMT, in the case of seconds-since-the-epoch input:
[% date.format(filemod, '%d-%b-%Y', 'en_GB', 1) %]
Note that in this case, if the local time is not GMT, then also specifying '%Z' (time zone) in the format parameter will lead to an
extremely misleading result.
Any or all of these parameters may be named. Positional parameters should always be in the order "($time, $format, $locale)".
[% date.format(format => '%H:%M:%S') %]
[% date.format(time => filemod, format => '%H:%M:%S') %]
[% date.format(mytime, format => '%H:%M:%S') %]
[% date.format(mytime, format => '%H:%M:%S', locale => 'fr_FR') %]
[% date.format(mytime, format => '%H:%M:%S', gmt => 1) %]
...etc...
The "now()" method returns the current system time in seconds since the epoch.
[% date.format(date.now, '%A') %]
The "calc()" method can be used to create an interface to the "Date::Calc" module (if installed on your system).
[% calc = date.calc %]
[% calc.Monday_of_Week(22, 2001).join('/') %]
The "manip()" method can be used to create an interface to the "Date::Manip" module (if installed on your system).
[% manip = date.manip %]
[% manip.UnixDate("Noon Yesterday","%Y %b %d %H:%M") %]
AUTHORS
Thierry-Michel Barral wrote the original plugin.
Andy Wardley provided some minor fixups/enhancements, a test script and documentation.
Mark D. Mills cloned "Date::Manip" from the "Date::Calc" sub-plugin.
COPYRIGHT
Copyright (C) 2000-2007 Thierry-Michel Barral, Andy Wardley.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Template::Plugin, POSIX
perl v5.14.2 2012-01-13 Template::Plugin::Date(3pm)