Visit Our UNIX and Linux User Community


Script to change Timezone(Solaris)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to change Timezone(Solaris)
# 1  
Old 10-23-2009
Script to change Timezone(Solaris)

india
22/11/2009 10:00:00 AM
sweden
22/11/2009 01:30:00 PM

As mentioned above i will get the datetime string from my customer and i need to change that String into diffrnt timezone as mentioned above.

---------- Post updated at 01:54 AM ---------- Previous update was at 01:01 AM ----------

Quote:
Originally Posted by vikas482
india
22/11/2009 10:00:00 AM
sweden
22/11/2009 01:30:00 PM

As mentioned above i will get the datetime string from my customer and i need to change that String into diffrnt timezone as mentioned above.


Your help will be highly appreciated
# 2  
Old 10-23-2009
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
# 3  
Old 10-23-2009
Use GNU date
Code:
$  date -d "11/22/2009 10:00:00 AM + 210 minutes" "+%d/%m/%Y %r"
22/11/2009 01:30:00 PM


Last edited by rdcwayx; 10-23-2009 at 06:54 AM..
# 4  
Old 10-23-2009
Quote:
Originally Posted by rdcwayx
Use GNU date
Code:
date -d "11/22/2009 10:00:00 AM + 210 minutes"


Hi,

Solaris doesn't support this.


Regards,
Vikas MahajanSmilie
# 5  
Old 10-23-2009
Quote:
Originally Posted by vikas482
Hi,

Solaris doesn't support this.


Regards,
Vikas MahajanSmilie
But you can install GNU date in your home directory, if you don't have root permission.

I run the command on my Solaris box.
# 6  
Old 10-23-2009
Use TZ variable to change the date

Previous Thread | Next Thread
Test Your Knowledge in Computers #264
Difficulty: Easy
Alan Turing worked at MIT where he designed the Automatic Computing Engine, which was one of the first designs for a stored-program computer.
True or False?

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can someone please show me a very simple "expect" script to change password in Solaris please?

Ladies & Gents, Can one of you gurus please show me a very simple "expect" script to change the password in Solaris in a script, please? Nothing fancy, no error checking, no nothing. Just to change the password of a new user, it's all. Many thanks in advance. U guys have honestly earned my... (1 Reply)
Discussion started by: Hiroshi
1 Replies

2. Solaris

Solaris 11 global zone timezone

Am new on Solaris If I compare with ESXi default timezone is UTC and we have to set BIOS timezone to UTC too . What we follow and best practice in Solaris Sparc servers . Thanks in advance . (2 Replies)
Discussion started by: Shirishlnx
2 Replies

3. Shell Programming and Scripting

Need Help:Shell Script for Solaris to change the dates in a file by one week

I have to increase the date by one week in an input when script is executed in solaris. I was able to acheive this using ksh script that is working in Linux enivironment, when i execute the same script in Solaris i am getting below error: /var/tmp\n\r-> ./script.ksh date: illegal option -- d... (3 Replies)
Discussion started by: sriramanaramoju
3 Replies

4. Solaris

Change timezone in Solaris 11

I was trying to change timezone on my new solaris-11 server to US/Pacific, but not successfull. root@tsapp01 # grep TZ /etc/default/init TZ=localtime Can somebody share something on this ? It seems, /etc/TIMEZONE is no longer in use for Solaris 11 (2 Replies)
Discussion started by: solaris_1977
2 Replies

5. Programming

Shell script to get Timezone

Hi friends i need to writing a code to use the longitue and latitude to get a time zone. Example below Logitude Latitude OMAN 21.9 56.6 BRGHT 27.57 -89.4 BLUGL 26.25 -91.95 latitude lines run horizontally Longitude are vertical lines ... (13 Replies)
Discussion started by: ajayram_arya
13 Replies

6. UNIX for Advanced & Expert Users

Log for Timezone change in unix server

There is a unix server where the time zone has been changed from EST to CST.Can we get any kind of log when it was changed anywhere in the unix machine. Also the path for the same. If there is any other way to know this please let me know (3 Replies)
Discussion started by: dr46014
3 Replies

7. Solaris

How to change Timezone without restarting teh server

Hi I have changed my timezone using the command export TZ='Asia/Calcutta" but teh affect is taking place only in teh shell where I am logged in. If I export teh variable when I open the new session, things are fine. Can I affetct the change universally, without restarting the server. ... (2 Replies)
Discussion started by: krishan
2 Replies

8. UNIX for Advanced & Expert Users

TimeZone changing in Solaris

I've date back one of my Unix WS ,after that again i want to return to real date,but after running: # date -u mmddHHMMyy the clock immediately returns to GMT timezone that is different with my local timezone. any suggestion could be useful... tanx --nikk (2 Replies)
Discussion started by: nikk
2 Replies

Featured Tech Videos