Sponsored Content
Top Forums Shell Programming and Scripting Awk: time intervals based on epoch time Post 302947142 by Chubler_XL on Monday 15th of June 2015 08:31:15 PM
Old 06-15-2015
Nice solution RudiC! You can set TZ for your awk process like this:

Code:
TZ=GMT-3 awk -F"-" '
...

This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pls Help me out ... I want to check process status at regular intervals of time

I want to check process status at regular interval of time ... so i ha wirtten this BUT its not working when i placed this peace of code in .sh .. please help me out #!/bin/sh w = ps -ef|grep processname | wc - l echo $w if ; then Banner "Proceesname Problem" else Banner " Running... (5 Replies)
Discussion started by: srinivasvandana
5 Replies

2. Red Hat

How do sa1/sar time intervals work?

Hi, I have set up sar on my RedHat and Fedora Linux systems. I am running sa1 from cron: 0 8-17 * * 1-5 /usr/lib/sa/sa1 1200 3 & The 1200 and 3 parameters tell sa1 to save data every 1200 seconds (== 20 minutes) and to write 3 times. When I run sar to observe my data, I'll see... (1 Reply)
Discussion started by: mschwage
1 Replies

3. Shell Programming and Scripting

Convert Epoch time format to normal date time format in the same file

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

4. Shell Programming and Scripting

Convert Epoch Time to Standard Date and Time & Vice Versa

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)
Discussion started by: DrivesMeCrazy
5 Replies

5. Shell Programming and Scripting

how to convert date time to epoch time in solaris

Hi, Is there any easy way to convert date time(stored in shell variable ) to epoch time in solaris box? As +%s is working on linux but not on solaris, also -d option is not working. Any suggestion please? (6 Replies)
Discussion started by: anshuman0507
6 Replies

6. Shell Programming and Scripting

Shell script to convert epoch time to real time

Dear experts, I have an epoch time input file such as : - 1302451209564 1302483698948 1302485231072 1302490805383 1302519244700 1302492787481 1302505299145 1302506557022 1302532112140 1302501033105 1302511536485 1302512669550 I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies

7. Shell Programming and Scripting

Using awk or nawk to convert epoch time to date format

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

8. Shell Programming and Scripting

Calculating the epoch time from standard time using awk and calculating the duration

Hi All, I have the following time stamp data in 2 columns Date TimeStamp(also with milliseconds) 05/23/2012 08:30:11.250 05/23/2012 08:30:15.500 05/23/2012 08:31.15.500 . . etc From this data I need the following output. 0.00( row1-row1 in seconds) 04.25( row2-row1 in... (5 Replies)
Discussion started by: ks_reddy
5 Replies

9. Shell Programming and Scripting

Converting real time to epoch time

# 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

10. UNIX for Dummies Questions & Answers

Condition based on Timestamp (Date/Time based) from logfile (Epoch seconds)

Below is the sample logfile: Userids Date Time acb Checkout time: 2013-11-20 17:00 axy Checkout time: 2013-11-22 12:00 der Checkout time: 2013-11-17 17:00 xyz Checkout time: 2013-11-19 16:00 ddd Checkout time: 2013-11-21 16:00 aaa Checkout... (9 Replies)
Discussion started by: asjaiswal
9 Replies
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)
All times are GMT -4. The time now is 03:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy