01-08-2010
yes you right I gues this one should work:
expr `date +%s` - `date -u +%s`
10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
I have a list of interfaces and time the interface was last active. I can't figure out how to convert the time in the second column,
Fa1/14 0
Se0/0/0 0
Fa1/11 0
Fa1/9 0
Fa1/0 0
Se0/0/1 1240401408
Gi1/0 0
Fa0/0 1240401408
Fa1/3 0
Fa1/8 0
Fa1/15 0
Fa1/13 0
Fa1/10 0
Fa1/1 0
Fa1/12... (7 Replies)
Discussion started by: mrlayance
7 Replies
3. Shell Programming and Scripting
Hi,
I need to convert a number representing time in UTC seconds to a date. Ex:
3BE0082C --> Oct 31 2001 15:31:08
I have tried the following perl command but it gives a different answer?
$ perl -e 'print scalar localtime(shift), "\n"' 3BE00B2C
Thu Jan 1 03:00:03 1970
Any ideas? Thanks. :) (10 Replies)
Discussion started by: GNMIKE
10 Replies
4. 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
5. Shell Programming and Scripting
Hello All -
I have a script that grabs data from the net and outputs the following data
46029 46.144 -124.510 2010 07 26 22 50 320 4.0 6.0 2.2 9 6.8 311 1012.1 -0.9 13.3 13.5 13.3 - -
46041 47.353 -124.731 2010 07 26 22 50 250 2.0 3.0 1.6 8 6.4 - 1011.6 - ... (0 Replies)
Discussion started by: drexnefex
0 Replies
6. AIX
Okay, so let's say we have a string like:
20110105_193345
This represents:
January 5th, 2011 = 20110105
24-hour style time 19:33:45 = 193345
Okay, so we have our time. It's January 5th, 2011 at 19:33:45. I want to convert this time from Eastern Time Zone (which it currently is in)... (1 Reply)
Discussion started by: syndex
1 Replies
7. 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
8. UNIX for Dummies Questions & Answers
Hi,
A few days ago I changed my CentOS box's timezone to -07:00.
Now the date commands output look like this (run almost simultaneously, less than 1 second delay)..
# date
Mon Sep 5 20:23:40 PDT 2011
# date -u
Tue Sep 6 03:24:05 UTC 2011
The hours difference seems correct, but why is... (2 Replies)
Discussion started by: forte712
2 Replies
9. AIX
Hello AIX friends,
We have timezone settings on our AIX 6.1 boxes set to Europe/London.
How can I change it to UTC timezone with Daylight saving disabled.
After running "smit chtz_user" I don't see UTC option in the listing.
Please advise.
TIA (3 Replies)
Discussion started by: prvnrk
3 Replies
10. Shell Programming and Scripting
Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone.
For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies
LEARN ABOUT REDHAT
tzfile
TZFILE(5) File Formats Manual TZFILE(5)
NAME
tzfile - time zone information
SYNOPSIS
#include <tzfile.h>
DESCRIPTION
The time zone information files used by tzset(3) begin with the magic characters "TZif" to identify then as time zone information files,
followed by sixteen bytes reserved for future use, followed by six four-byte values of type long, written in a ``standard'' byte order (the
high-order byte of the value is written first). These values are, in order:
tzh_ttisgmtcnt
The number of UTC/local indicators stored in the file.
tzh_ttisstdcnt
The number of standard/wall indicators stored in the file.
tzh_leapcnt
The number of leap seconds for which data is stored in the file.
tzh_timecnt
The number of "transition times" for which data is stored in the file.
tzh_typecnt
The number of "local time types" for which data is stored in the file (must not be zero).
tzh_charcnt
The number of characters of "time zone abbreviation strings" stored in the file.
The above header is followed by tzh_timecnt four-byte values of type long, sorted in ascending order. These values are written in ``stan-
dard'' byte order. Each is used as a transition time (as returned by time(2)) at which the rules for computing local time change. Next
come tzh_timecnt one-byte values of type unsigned char; each one tells which of the different types of ``local time'' types described in
the file is associated with the same-indexed transition time. These values serve as indices into an array of ttinfo structures that
appears next in the file; these structures are defined as follows:
struct ttinfo {
long tt_gmtoff;
int tt_isdst;
unsigned int tt_abbrind;
};
Each structure is written as a four-byte value for tt_gmtoff of type long, in a standard byte order, followed by a one-byte value for
tt_isdst and a one-byte value for tt_abbrind. In each structure, tt_gmtoff gives the number of seconds to be added to UTC, tt_isdst tells
whether tm_isdst should be set by localtime(3), and tt_abbrind serves as an index into the array of time zone abbreviation characters that
follow the ttinfo structure(s) in the file.
Then there are tzh_leapcnt pairs of four-byte values, written in standard byte order; the first value of each pair gives the time (as
returned by time(2)) at which a leap second occurs; the second gives the total number of leap seconds to be applied after the given time.
The pairs of values are sorted in ascending order by time.
Then there are tzh_ttisstdcnt standard/wall indicators, each stored as a one-byte value; they tell whether the transition times associated
with local time types were specified as standard time or wall clock time, and are used when a time zone file is used in handling POSIX-
style time zone environment variables.
Finally, there are tzh_ttisgmtcnt UTC/local indicators, each stored as a one-byte value; they tell whether the transition times associated
with local time types were specified as UTC or local time, and are used when a time zone file is used in handling POSIX-style time zone
environment variables.
Localtime uses the first standard-time ttinfo structure in the file (or simply the first ttinfo structure in the absence of a standard-time
structure) if either tzh_timecnt is zero or the time argument is less than the first transition time recorded in the file.
TZFILE(5)