Sponsored Content
Top Forums Shell Programming and Scripting Epoch & Unix Timestamp Conversion Tools Post 302605610 by aish11 on Thursday 8th of March 2012 02:27:09 AM
Old 03-08-2012
Epoch & Unix Timestamp Conversion Tools

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 the commands.


Eg: 08 Mar 2012 08:00:00 UTC to epoch time

and 08 Mar 2012 06:00:00 UTC to epoch time


for epochtime details you can refer this link
Epoch Converter - Unix Timestamp Converter


Thanks
 

9 More Discussions You Might Find Interesting

1. Linux

ESQL/C to Oracle Conversion Tools.

The oracle site has such a tool for several platforms but Linux :mad: Would anyone be able to point me in the direction of an Informix ESQL/C to Pro/C convertor that will run on Linux? Thanks (1 Reply)
Discussion started by: mbb
1 Replies

2. Shell Programming and Scripting

conversion from EPOCH timestamp to local time zone

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)
Discussion started by: abhijeetkul
2 Replies

3. Shell Programming and Scripting

conversion of different timestamp to standard timestamp

hi i need a scrit to convert one date format to another. for example i have three columns in a file which gets a different format, but lastly i want output with stadard timestamp as "yyyy-mm-dd hh:mm:ss" column1 column2 ... (2 Replies)
Discussion started by: dprakash
2 Replies

4. Shell Programming and Scripting

epoch conversion

I need to convert an epoch time from a file into a standard UTC time and output it in the same format but I'm not sure what's the best approach here's the input file and the bold part is what I need to convert. 1,1,"sys1",60,300000 2,"E:",286511144960 3,1251194521,"E:",0,0... (2 Replies)
Discussion started by: satchy321
2 Replies

5. Shell Programming and Scripting

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 : date -d "2007-09-01 17:30:40" '+%s' But this gives me below error date: illegal option -- d Usage: date OS: AIX... (6 Replies)
Discussion started by: bpaac
6 Replies

6. Shell Programming and Scripting

Shell Script for Epoch Time Conversion

Hi there I came across this script online to convert Epoch time to proper date format, but I am receiving the following error Also, I have HISTTIMEFORMAT set in user's .profile so that their history output shows time stamps. Additionally I have changed their .history location to a dedicated... (9 Replies)
Discussion started by: hedkandi
9 Replies

7. Shell Programming and Scripting

Different epoch conversion result for bash and csh users

Hi there I'm using this script to convert command line history with Epoch time stamp to human readable. While it works fine with users with /bin/csh shell, it fails to convert for users with /bin/bash shell. Why is this happening? I even changed and added * and after the # but it still didnt... (2 Replies)
Discussion started by: hedkandi
2 Replies

8. Programming

Python conversion to epoch time

Hi. I have timestamps that I am trying to convert to epoch time. An example: I am trying to convert this to an epoch timestamp but have one little glitch. I have this: import time date_time = '' pattern = '' epoch = int(time.mktime(time.strptime(date_time, pattern))) print epoch... (1 Reply)
Discussion started by: treesloth
1 Replies

9. UNIX for Dummies Questions & Answers

Convert Epoch to timestamp in a file

Hi Team, Could you please let me know ,how to convert Epoch column to timestamp in a flat file. "57894"|"1454247163111"|"""HH""" "57897"|"1454247163111"|"""HH""" "7906"|"1454247163111"|"""ss""" I want second field as timestamp. This thread has been moved from a non-technical forum to... (6 Replies)
Discussion started by: shabeena
6 Replies
Epoch(3)						User Contributed Perl Documentation						  Epoch(3)

NAME
Time::Epoch - Convert between Perl epoch and other epochs SYNOPSIS
#!/usr/bin/perl -wl use Time::Epoch; my $perlsec = 966770660; # Sun Aug 20 07:24:21 2000 -0400 on Mac OS my $epochsec = perl2epoch($perlsec, 'macos', '-0400'); my $perlsec2 = epoch2perl($epochsec, 'macos', '-0400'); print $perlsec; print $perlsec2; print $epochsec; # correct time on Unix: print scalar localtime $perlsec; # correct time on Mac OS (-0400): print scalar localtime $epochsec; DESCRIPTION
Exports two functions, "perl2epoch" and "epoch2perl". Currently only goes between Perl (Unix) epoch and Mac OS epoch. This is in preparation for an eventual move of Perl to its own universal epoch, so we can get the system epoch of any platform that differs from Perl's. Epochs o macos Takes additional optional parameter of time zone differential. If time zone differential not supplied, we guess by getting the different between "localtime" and "gmtime" with <Time::Local::timelocal>. BUGS
o Hm. With the above test, "scalar localtime $perlsec" under my Linux box and "scalar localtime $epochsec" under my Mac OS box are off by one second from each other. Maybe a leap second thing? Odd. AUTHOR
Chris Nandor <pudge@pobox.com>, http://pudge.net/ Copyright (c) 2000-2003 Chris Nandor. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, distributed with Perl. SEE ALSO
perl(1), perlport(1), Time::Local. perl v5.18.2 2003-05-21 Epoch(3)
All times are GMT -4. The time now is 11:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy