01-24-2012
converting epoch time to ddmmyy format
I can not find a working script or way to do this on sun solaris , can someone please guide me?
e.g 1327329935 epoch secs = 012312 (ddmmyy)
thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I would like to convert epoch time from the logs to readible fromat.
How do I do it within shell?
Thanks! (11 Replies)
Discussion started by: cin2000
11 Replies
2. Shell Programming and Scripting
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)
Discussion started by: rk4k
3 Replies
3. UNIX for Dummies Questions & Answers
Hi everybody,
I want to get the current time in epoch format (in UNIX or Korn Shell) and store it in a variable called
currentTime. Any response will be highly appreciated:)
Thanks in advance,
omoyne:D (8 Replies)
Discussion started by: omoyne
8 Replies
4. Shell Programming and Scripting
Hi,
Thanks bartus11 yesterday's code worked fine for me.
In meantime I've found another "issue".
As you can see highlighted, the time format in my original input in case of two rows which should be duplicited ,is differentwhat I need to do is to convert to this format "20110607-08:03:22"... (4 Replies)
Discussion started by: hernand
4 Replies
5. Programming
Hi all ,
I need to know how to convert a time stamp entered by the user to be converted to GMT/UTC(epoch time) using mktime() and gmtime()
for exapample the input will be put in the form
ptm.tm_sec = 0;
ptm.tm_min = 59;
ptm.tm_hour = 11;
ptm.tm_mday = 20;... (2 Replies)
Discussion started by: ada
2 Replies
6. Shell Programming and Scripting
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)
Discussion started by: minigts
5 Replies
7. Shell Programming and Scripting
# date +%s -d "Mon Feb 11 02:26:04"
1360567564
# perl -e 'print scalar localtime(1360567564), "\n";'
Mon Feb 11 02:26:04 2013
the epoch conversion is working fine. but one of my application needs 13 digit epoch time as input
1359453135154
rather than 10 digit epoch time 1360567564... (3 Replies)
Discussion started by: vivek d r
3 Replies
8. UNIX for Dummies Questions & Answers
I have a Raspberry Pi that logs some temperatures using Onewire. Data is collected with RRDTool.
The command sudo rrdtool fetch ute_temp.rrd AVERAGE -s -1h > ./test.log
and then cat test.log gives the result
1388608500: 2.3579639836e+00
.
How do I write a script that converts the Epoch time... (4 Replies)
Discussion started by: nilekl
4 Replies
9. Shell Programming and Scripting
Can someone help me to write a shell script to convert epoch timestamp into human readable format
1394553600,"test","79799776.0","19073982.728571","77547576.0","18835699.285714"
1394553600,"test1","80156064.0","19191275.014286","62475360.000000","14200554.720000"... (10 Replies)
Discussion started by: Moon1234
10 Replies
10. Shell Programming and Scripting
I am trying to create a script that will take epoch (input from command line) and convert it into a readable format in bash/shell
---------- Post updated at 08:03 PM ---------- Previous update was at 07:59 PM ----------
#!bin/bash
read -p "Please enter a number to represent epoch time:"... (9 Replies)
Discussion started by: sprocket
9 Replies
LEARN ABOUT DEBIAN
dbix::class::datetime::epoch
DBIx::Class::DateTime::Epoch(3pm) User Contributed Perl Documentation DBIx::Class::DateTime::Epoch(3pm)
NAME
DBIx::Class::DateTime::Epoch - Automatic inflation/deflation of epoch-based columns to/from DateTime objects
SYNOPSIS
package MySchema::Foo;
use base qw( DBIx::Class );
__PACKAGE__->load_components( qw( DateTime::Epoch TimeStamp Core ) );
__PACKAGE__->add_columns(
name => {
data_type => 'varchar',
size => 10,
},
bar => { # epoch stored as an int
data_type => 'bigint',
inflate_datetime => 1,
},
baz => { # epoch stored as a string
data_type => 'varchar',
size => 50,
inflate_datetime => 'epoch',
},
# working in conjunction with DBIx::Class::TimeStamp
creation_time => {
data_type => 'bigint',
inflate_datetime => 1,
set_on_create => 1,
},
modification_time => {
data_type => 'bigint',
inflate_datetime => 1,
set_on_create => 1,
set_on_update => 1,
}
);
DATETIME
::FORMAT DEPENDENCY
There have been no assumptions made as to what RDBMS you will be using. As per the note in the DBIx::Class::InflateColumn::DateTime
documentation, you will need to install the DateTime::Format::* module that matches your RDBMS of choice.
DESCRIPTION
This module automatically inflates/deflates DateTime objects from/to epoch values for the specified columns. This module is essentially an
extension to DBIx::Class::InflateColumn::DateTime so all of the settings, including "locale" and "timezone", are also valid.
A column will be recognized as an epoch time given one of the following scenarios:
o "data_type" is an "int" of some sort and "inflate_datetime" is also set to a true value
o "data_type" is some other value (e.g. "varchar") and "inflate_datetime" is explicitly set to "epoch".
DBIx::Class::TimeStamp can also be used in conjunction with this module to support epoch-based columns that are automatically set on
creation of a row and updated subsequent modifications.
METHODS
add_columns( )
Provides backwards compatibility with the older DateTime::Epoch API.
_inflate_to_datetime( )
Overrides column inflation to use "Datetime->from_epoch".
_deflate_from_datetime( )
Overrides column deflation to call "epoch()" on the column value.
SEE ALSO
o DBIx::Class
o DBIx::Class::TimeStamp
o DateTime
AUTHORS
Brian Cassidy <bricas@cpan.org>
Adam Paynter <adapay@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2006-2012 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-02-01 DBIx::Class::DateTime::Epoch(3pm)