Date conversion from Standard/given format to seconds/epoch
I am trying get time difference of two dates in secs. Initially I want to convert a standard date format to epoch for two dates and then subtract the two epoch dates.
Example :
But this gives me below error
OS: AIX 5.3.0.0
Thanks in advance
Last edited by Franklin52; 07-15-2011 at 04:12 PM..
Reason: Please use code tags for data and code samples, thank you
I have a file named "suspected" with series of line like these :
{'protocol': 17, 'service': 'BitTorrent KRPC', 'server': '219.78.120.166', 'client_port': 52044, 'client': '10.64.68.44', 'server_port': 8291, 'time': 1226506312L, 'serverhostname': ''}
{'protocol': 17, 'service': 'BitTorrent... (3 Replies)
Hi guys,
I know that this topic has been discuss numerous times, and I have search the net and this forum for it.
However, non able to address the problem I faced so far.
I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
System: HP-UX
Kornshell
Perl is installed, but not POSIX
Hello,
I am calculating a future date/time. To do this I take the system date in epoch format and add to it. I now need to take the new epoch date and convert it to MMDDYYHHmm format.
Any help with this is greatly appreciated. (4 Replies)
Hello
I have log file from solaris system which has date field converted by Java application using System.currentTimeMillis() function, example is 1280943608380 which equivalent to GMT: Wed, 04 Aug 2010 17:40:08 GMT.
Now I need a function in shell script which will convert 1280943608380... (3 Replies)
Hi All,
Can someone please let me know how can i convert the date format in unix as follow:
From: 24 Oct 2011
i.e $(date +'%d %b %Y')
To: 111024
i.e $(date +%y%m%d)
Thanks in advance (3 Replies)
Looking for some help and usually when I do a search this site comes up. Hopefully someone can give me a little direction as to how to use one of these two commands to achieve what I'm trying to do.
What am I trying to do?
I need to take the time value in epoch format returned from the... (5 Replies)
Hi All,
I have scenario where i have to compare two dates.
I thought of converting them to epoch seconds and do a numeric comparison.
This works fine on Linux systems.
$ date -d '2015/12/31' +%s
1451538000
$ date +%s
1449159121
But we don't have -d option in HPUX.
What would be... (5 Replies)
Discussion started by: veeresh_15
5 Replies
LEARN ABOUT DEBIAN
email::date::format
Email::Date::Format(3pm) User Contributed Perl Documentation Email::Date::Format(3pm)NAME
Email::Date::Format - produce RFC 2822 date strings
SYNOPSIS
use Email::Date::Format qw(email_date);
my $header = email_date($date->epoch);
Email::Simple->create(
header => [
Date => $header,
],
body => '...',
);
DESCRIPTION
This module provides a simple means for generating an RFC 2822 compliant datetime string. (In case you care, they're not RFC 822 dates,
because they use a four digit year, which is not allowed in RFC 822.)
FUNCTIONS
email_date
my $date = email_date; # now
my $date = email_date( time - 60*60 ); # one hour ago
"email_date" accepts an epoch value, such as the one returned by "time". It returns a string representing the date and time of the
input, as specified in RFC 2822. If no input value is provided, the current value of "time" is used.
"format_date" is exported only if requested.
email_gmdate
my $date = email_gmdate;
"email_gmdate" is identical to "email_date", but it will return a string indicating the time in Greenwich Mean Time, rather than local
time.
"format_gmdate" is exported only if requested.
PERL EMAIL PROJECT
This module is maintained by the Perl Email Project
<http://emailproject.perl.org/wiki/Email::Date::Format>
AUTHOR
Ricardo SIGNES, <rjbs@cpan.org>.
Adapted from Email::Date, by Casey West.
COPYRIGHT
Copyright (c) 2007, Ricarod SIGNES. This module is free software; you can redistribute it and/or modify it under the same terms as Perl
itself.
perl v5.8.8 2007-12-13 Email::Date::Format(3pm)