11-17-2010
@mithunpatel
We assume you mean the unix "dc" (desktop calculator) program.
Please post the script.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
i need to convert below date/time format into epoch time
YYYY-m-d H:M
below the example:
a=`date +"%F %H:%M"`
echo $a
Convert $a to epoch time
------------------------------------------------------------------------
lets take an example
if $a=1.03
here i want the epoch time... (3 Replies)
Discussion started by: ali560045
3 Replies
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
Hi guys,
Im trying to subtract time in ksh script. i.e. basically im querying a database and i want to get the time 10mins before hand..(from)
in ksh
CurrMin=$(date "+%M")
from=`expr $CurrMin - 10`
to=$CurrMin
however if i run this i say at 2 or 3 mins past the hour, i.e.... (7 Replies)
Discussion started by: k00061804
7 Replies
5. Shell Programming and Scripting
Hello,
I'm trying to create a shell script (#!/bin/sh) which should tell me the age of a file in minutes...
I have a process, which delivers me all 15 minutes a new file and I want to have a monitoring script, which sends me an email, if the present file is older than 20 minutes.
To do... (10 Replies)
Discussion started by: worm
10 Replies
6. Shell Programming and Scripting
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
# 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. Shell Programming and Scripting
Hello All,
I have a Perl script I'm writing where I ask the user to enter a "start time" for something. The "$start_time" will be in the format of:
# The Time CLI Option Can be in the format of:
--start-time="1day"
--start-time="2hours"
--start-time="45min"
... (1 Reply)
Discussion started by: mrm5102
1 Replies
9. Shell Programming and Scripting
I have a list of epoch times delimited by "-" as follows:
1335078000 - 1335176700
1335340800 - 1335527400
1335771300 - 1335945600
1336201200 - 1336218000
The corresponding dates are:
20120422 1000 - 20120423 1325
20120425 1100 - 20120427 1450
20120430 1035 - 20120502 1100 ... (3 Replies)
Discussion started by: alex2005
3 Replies
10. Shell Programming and Scripting
I have unix epoch time 1441678454803, Can you please help me to print this time in below format ?
DAY,HOUR,MIN,SEC
Appreciate your help!!!
Thanks,
Prince (7 Replies)
Discussion started by: prince1987
7 Replies
LEARN ABOUT MOJAVE
time::epoch
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)