Using AIX6.1 box.
I have UTC time value and need to convert it to local time value - I mean time zone and DST should be taken into consideration.
I hope it could be done using shell environment - I don't want to write a program.
thanks
Vilius
---------- Post updated at 02:30 PM ---------- Previous update was at 08:12 AM ----------
ok I found it by myself - the difference between UTC and local time can be calculated:
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)
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)
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)
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)
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)
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)
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)
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)
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)
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 FREEBSD
adjkerntz
ADJKERNTZ(8) BSD System Manager's Manual ADJKERNTZ(8)NAME
adjkerntz -- adjust the local time CMOS clock to reflect time zone changes and keep the current timezone offset for the kernel
SYNOPSIS
adjkerntz -i
adjkerntz -a [-s]
DESCRIPTION
The adjkerntz utility maintains the proper relationship between the kernel clock, which is always set to UTC and the CMOS clock, which may be
set to local time. The adjkerntz utility also informs the kernel about machine timezone shifts in order to maintain proper timestamps for
local time file systems such as the MS-DOS file system. The main purpose of maintaining these timestamps properly is to keep the timestamps
of a FreeBSD MS-DOS file system and an MS-DOS operating system synchronized when they are installed on the same system rather than fixing
broken MS-DOS file timestamps. If the file /etc/wall_cmos_clock exists, it means that the CMOS clock keeps local time (MS-DOS and MS-Windows
compatible mode). If that file does not exist, it means that the CMOS clock keeps UTC time. The adjkerntz utility passes this state to the
machdep.wall_cmos_clock kernel variable.
Adjustments may be needed at system startup and shutdown, and whenever a time zone change occurs. To handle these different situations,
adjkerntz is invoked in two ways:
-i This form handles system startups and shutdowns. The adjkerntz utility is invoked with this option from /etc/rc on entry to multi-user
mode, before any other daemons have been started. The adjkerntz utility puts itself into the background. Then, for a local time CMOS
clock, adjkerntz reads the local time from it and sets the kernel clock to the corresponding UTC time. The adjkerntz utility also
stores the local time zone offset in the machdep.adjkerntz kernel variable, for use by subsequent invocations of 'adjkerntz -a' and by
local time file systems.
For a local time CMOS clock 'adjkerntz -i' pauses and remains inactive as a background daemon until it receives a SIGTERM. The SIGTERM
will normally be sent by init(8) when the system leaves multi-user mode (usually, because the system is being shut down). After
receiving the SIGTERM, adjkerntz reads the UTC kernel clock and updates the CMOS clock, if necessary, to ensure that it reflects the
current local time zone. Then adjkerntz exits.
-a [-s]
This form is used to update the local time CMOS clock and kernel machdep.adjkerntz variable when time zone changes occur, e.g., when
entering or leaving daylight savings time. The adjkerntz utility uses the kernel clock's UTC time, the previously stored time zone
offset, and the changed time zone rule to calculate a new time zone offset. It stores the new offset into the machdep.adjkerntz kernel
variable and updates the wall CMOS clock to the new local time. If 'adjkerntz -a' was started at a nonexistent time (during a timezone
change), it exits with a warning diagnostic unless the -s option was used, in which case adjkerntz sleeps 30 minutes and tries again.
This form should be invoked from root's crontab(5) every half hour between midnight and 5am, when most modern time zone changes occur.
Warning: do not use the -s option in a crontab(5) command line, or multiple 'adjkerntz -a' instances could conflict with each other.
The adjkerntz utility clears the kernel timezone structure and makes the kernel clock run in the UTC time zone. Super-user privileges are
required for all operations.
ENVIRONMENT
TZ Time zone change rule, see tzset(3); not needed when tzsetup(8) or zic(8) is used.
FILES
/etc/localtime Current zoneinfo file, see tzsetup(8) and zic(8).
/etc/wall_cmos_clock Empty file. Its presence indicates that the machine's CMOS clock is set to local time, while its absence indicates a
UTC CMOS clock.
DIAGNOSTICS
No diagnostics. If an error occurs, adjkerntz logs an error message via syslog(3) and exits with a nonzero return code.
SEE ALSO tzset(3), crontab(5), mount_msdosfs(8), rc(8), sysctl(8), tzsetup(8), zic(8)HISTORY
The adjkerntz utility appeared in FreeBSD 1.0.
AUTHORS
Andrey A. Chernov <ache@astral.msk.su>
BSD March 8, 2012 BSD