hello gurus,
i want a perl/shell script which once invoked should convert a set of EPOCH timestamps to local time ( IST..i want) .
how does it work ,i have an idea on that..but writing a perl/shell script for it is not possible for me...so i need help for the same.
my exact requirement is... (2 Replies)
Solaris 10 doesn't seem to like me a lot. I am trying to run a simple script to accept date and return epoch of that date:
#!/usr/bin/perl -w
use strict;
use Time::ParseDate;
my($date1)="Mon Mar 27 05:54:08 CDT 2009";
chomp $date1;
#Convert to seconds since start of epoch
my $time1 =... (3 Replies)
Hello
I have a the creation date of a file stored in a variable in the following format:
Wed May 06 10:14:58 2009Is there a way I can echo the variable and display it in epoch time?
I've done a lot of searching on this topic, but haven't managed to get a solution. I'm on Solaris 10.
... (2 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)
Hi All,
Please read the below data carefully.
I need an unix command for converting unix timestamp to Epoch timestamp.
I need to daily convert this today's unix(UTC) time to epoch time, so i am thinking to make a shellscript for this.
Please help me for this by providing... (3 Replies)
how can i modify the following command to instead provide the epoch time of the interfaces file?
perl -le 'print scalar localtime ((stat "/home/skysmart/interfaces"))'
Tue Feb 19 03:44:52 2013
i'm hoping to get the equivalent of this command:
stat --format=%Y /home/skysmart/interfaces
... (2 Replies)
Hello I have a file : file1.txt with the below contents :
237176 test1 test2 1442149024
237138 test3 test4 1442121300
237171 test5 test7 1442112823
237145 test9 test10 1442109600
In the above file fourth field represents the timestamp in Unix format.
I found a command which converts... (6 Replies)
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)
Team,
I am working on a shell script and i am extracting a date string in "SunOS server" with below format.
Mon Jan 21 04:13:48 EST 2021
Can you please assist me the best way to convert the extracted string to epoch time like "date +%s" in Linux.
Thanks in advance (1 Reply)
Discussion started by: Girish19
1 Replies
LEARN ABOUT DEBIAN
datetime::format::epoch::tai64
DateTime::Format::Epoch::TAI64(3pm) User Contributed Perl Documentation DateTime::Format::Epoch::TAI64(3pm)NAME
DateTime::Format::Epoch::TAI64 - Convert DateTimes to/from TAI64 values
SYNOPSIS
use DateTime::Format::Epoch::TAI64;
my $dt = DateTime::Format::Epoch::TAI64
->parse_datetime( '4611686019483526367' );
# 2003-06-20T19:49:59
DateTime::Format::Epoch::TAI64->format_datetime($dt);
# 4611686019483526367
my $formatter = DateTime::Format::Epoch::TAI64->new();
$dt = $formatter->parse_datetime( '4611686019483526367' );
# 2003-06-20T19:49:59
$formatter->format_datetime($dt);
# 4611686019483526367
my $str_frmt = DateTime::Format::Epoch::TAI64->new(
format => 'string' );
$dt = $str_frmt->parse_datetime( "x40 x3exf3x69x6a" );
# 2003-06-20T19:49:59
$str_frmt->format_datetime($dt);
# "x40 x3exf3x69x6a"
DESCRIPTION
This module can convert a DateTime object (or any object that can be converted to a DateTime object) to a TAI64 value. The TAI64 timescale
covers the entire expected lifespan of the universe (at least, if you expect the universe to be closed).
METHODS
Most of the methods are the same as those in DateTime::Format::Epoch. The only difference is the constructor.
o new( [format => 'string'] )
Constructor of the formatter/parser object. If the optional format parameter is set to 'string', TAI64 values will be expected to be 8
byte strings.
SUPPORT
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details.
AUTHOR
Eugene van der Pijll <pijll@gmx.net>
COPYRIGHT
Copyright (c) 2003, 2004 Eugene van der Pijll. All rights reserved. This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
SEE ALSO
DateTime
datetime@perl.org mailing list
http://cr.yp.to/time.html
perl v5.10.1 2007-12-03 DateTime::Format::Epoch::TAI64(3pm)