Sponsored Content
Top Forums Shell Programming and Scripting Convert UTC time into current UNIX sever time zone Post 302826553 by Don Cragun on Thursday 27th of June 2013 12:42:25 AM
Old 06-27-2013
Quote:
Originally Posted by mohanalakshmi
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 zone i need to convert to that time zone(Not to the curent time only to the server time zone).Because my prog may run on different timezone servers.

Please help me guys.Thanks for the forum.
Saying that you have a UTC time stamp is ambiguous; please show us the format of the time stamps you have and the format of the time stamps you want to produce. What are you going to do with the timestamps in your XML input files?

Is there a /usr/gnu/bin/date or a /usr/bin/gdate installed on your Solaris system?
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert Unix Time to Standard Time

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

2. Shell Programming and Scripting

Convert UTC time to Date

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

3. AIX

Convert UTC time to local time ?

Hello, 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... (2 Replies)
Discussion started by: vilius
2 Replies

4. Shell Programming and Scripting

Find and Convert UTC Time to PST Time

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

5. AIX

Convert time (YYYYMMDD HHMMSS) to UTC

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

6. UNIX for Dummies Questions & Answers

UTC time and Local time

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

7. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies

8. Shell Programming and Scripting

Displaying current date time of EDT in IST time

Hi Folks, My server time is in EDT. And i am sending automated mails from that server in which i need to display the current date time as per IST (GMT+5:30). Please advice how to display the date time as per IST. IST time leads 9:30 mins to EDT. and i wrote something like below. ... (6 Replies)
Discussion started by: Showdown
6 Replies

9. AIX

Change Time Zone to UTC without DST

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. UNIX for Dummies Questions & Answers

How to change the time zone in UNIX??

hi, my system date and time zone is PDT. whenever i append date time stamp to a file it appends the system date thats PDT date time zone. i want to append GMT time zone. is there a mechanism or option which can append the date time stamp according to GMT. (4 Replies)
Discussion started by: Little
4 Replies
TZSETUP(8)						    BSD System Manager's Manual 						TZSETUP(8)

NAME
tzsetup -- set local timezone SYNOPSIS
tzsetup [-nrs] [-C chroot_directory] [zoneinfo_file | zoneinfo_name] DESCRIPTION
The tzsetup utility reads a database of timezone information and presents a menu allowing the user to select a specific zone without knowing the details of the database layout. The selected zone is installed as the system default zone. The tzsetup utility also determines whether any adjustment is necessary for systems where the hardware clock does not keep UTC. The following options are available: -C chroot_directory Open all files and directories relative to chroot_directory. -n Do not create or copy files. -r Reinstall the zoneinfo file installed last time. The name is obtained from /var/db/zoneinfo. -s Skip the initial question about adjusting the clock if not set to UTC. It is possible to short-circuit the menu system by specifying the location of a zoneinfo_file or the name of the zoneinfo_name on the command line; this is intended mainly for pre-configured installation scripts or people who know which zoneinfo they want to install. TIMEZONE DATABASE
The contents of the timezone database are indexed by /usr/share/zoneinfo/zone.tab. This file lists, for each timezone data file, the ISO 3166 territory code, approximate geographical coordinates (in ISO 6709 format), and location within the territory. The maintainers of the database maintain the following policies: 1. At least one zone for every country or inhabited geographical territory. 2. One zone for every distinct, documented timezone history since the beginning of the UNIX epoch (January 1, 1970, GMT). 3. Each zone is named for the most populous city therein. (Where possible, the database includes pre-1970 history for its city.) The source code to the database (/usr/src/share/zoneinfo/[a-z]*) contains many additional comments and documentation references for the his- torically minded. FILES
/etc/localtime current time zone file /etc/wall_cmos_clock see adjkerntz(8) /usr/share/misc/iso3166 mapping of ISO 3166 territory codes to names /usr/share/zoneinfo directory for zoneinfo files /usr/share/zoneinfo/zone.tab mapping of timezone file to country and location /var/db/zoneinfo saved name of the timezone file installed last EXAMPLES
Normal usage, to select the right zoneinfo file via the dialog-based user interface: tzsetup Install the file /usr/share/zoneinfo/Australia/Sydney: tzsetup /usr/share/zoneinfo/Australia/Sydney Install the zoneinfo file for Australia/Sydney, assumed to be located in /usr/share/zoneinfo: tzsetup Australia/Sydney After a reinstall of the zoneinfo files, you can reinstall the latest installed zoneinfo file (as specified in /var/db/zoneinfo): tzsetup -r SEE ALSO
date(1), adjtime(2), ctime(3), timezone(3), tzfile(5), adjkerntz(8), zdump(8), zic(8) DISCLAIMER
The representation of certain localities as being associated with certain countries and/or territories is for the purposes of identification only, and does not imply any endorsement or rejection on the part of the FreeBSD Project of the territorial claims of any entity. BUGS
Programs which are already running when tzsetup creates or updates /etc/localtime will not reflect the updated timezone. When the system is first configured for a non-UTC hardware clock, it is necessary to run adjkerntz(8) (which normally happens as a part of system startup) in order to update the kernel's idea of the correct timezone offset. BSD
October 21, 2009 BSD
All times are GMT -4. The time now is 08:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy