change country in date command


 
Thread Tools Search this Thread
Operating Systems AIX change country in date command
# 1  
Old 12-19-2007
Question change country in date command

Currently date command is showing following output

Code:
(ibm)jhamay:/home/jhamay->date
Wed Dec 19 14:19:25 PAKST 2007

I want to change PAKST to IST. I have searched through man pages but didn't find any relevant things.could you all please help me out.
# 2  
Old 12-19-2007
You have to change the timezone, which is stored in the variable TZ.

export TZ=IST[....]

Alas, i do not know of a predefined timezone called "IST", so you will have to contruct your own and call that "IST".

I hope this helps.

bakunin

Last edited by bakunin; 12-19-2007 at 08:10 AM..
# 3  
Old 12-19-2007
What OS (type/version of unix or AIX) are you using?

Code:
export TZ=ISTIMDT-5:30

Would be for the time in Mumbai.

If you want this to be system-wide (for all users) you will have to change something depending on your OS, probably put the TZ statement above into /etc/TIMEZONE
# 4  
Old 12-19-2007
Quote:
Originally Posted by jim mcnamara
What OS (type/version of unix or AIX) are you using?
Sorry to interrupt you, Jim, but this is the AIX forum and in AIX the version/release is - for this problem - irrelevant. The procedure hasn't changed since at least version 3.2.5 (which was back in the early nineties).

Quote:
If you want this to be system-wide (for all users) you will have to change something depending on your OS, probably put the TZ statement above into /etc/TIMEZONE
In AIX you have to put it into /etc/environment or use SMITty, which does that for you.

You might want to read this post for an explanation of how to contruct your timezone variable.
# 5  
Old 12-19-2007
my bad, but the recent versions of AIX are supposedly POSIXly-compliant, and that construction of a TZ variable is POSIX.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to change existing date to current date in a filename?

Suppose i have a list of files in a directory as mentioned below 1. Shankar_04152019_ny.txt 2. Gopi_shan_03122019_mi.txt 3. Siva_mourya_02242019_nd.txt .. . . . . 1000 . Jiva_surya_02282019_nd.txt query : At one shot i want to modify the above all filenames present in one path with... (4 Replies)
Discussion started by: Shankar455
4 Replies

2. HP-UX

awk command in hp UNIX subtract 30 days automatically from current date without date illegal option

current date command runs well awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat subtract 30 days fails awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies

3. Shell Programming and Scripting

Find week of the year for given date using date command inside awk

Hi all, Need an urgent help on the below scenario. script: awk -F"," 'BEGIN { #some variable assignment} { #some calculation and put values in array} END { year=#getting it from array and assume this will be 2014 month=#getting it from array and this will be 05 date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies

4. UNIX for Dummies Questions & Answers

Change Date in Variable

I am hoping someone can help me with this issue. I am extracting a date from a file that is in DD/MM/YYYY format using... expiry_date=`echo ${line}| awk -F, '{ print $4 }' | tr -d '\r'` What I need to do is amend the value so instead of getting 30/12/2016 I end up with 12/30/2016. I have... (11 Replies)
Discussion started by: theref
11 Replies

5. Shell Programming and Scripting

Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (7 Replies)
Discussion started by: ust3
7 Replies

6. Shell Programming and Scripting

Change the content of files but not change the date

I have 100 files in a directory , all the files have a word "error" and they are created in different date . Now I would like to change the word from "error" to "warning" , and keep the date of the files ( that means do not change the file creation date after change the word ) , can advise what can... (0 Replies)
Discussion started by: ust3
0 Replies

7. Shell Programming and Scripting

How to change date format in 'last' command?

hi.. i am new to here. can anybody tell me how can we change the date format in the 'last' command. EX- on running last command i am getting -- rruat pts/12 172.18.40.101 Tue May 3 12:59 still logged in rruat pts/10 blr2-3f-239.asco Tue May 3 12:59 - 13:09 ... (2 Replies)
Discussion started by: thearpit
2 Replies

8. Shell Programming and Scripting

hp-unix stat command to get last change date of file

I'm on hp-unix. I would like a variable to hold the last change date of a file. I looked at the man pages for stat, but I don't see any examples and can't get the syntax right. Can anyone help me? Thank you. (2 Replies)
Discussion started by: sboxtops
2 Replies

9. Shell Programming and Scripting

Format of SED command to change a date

I have a website. I have a directory within it with over a hundred .html files. I need to change a date within every file. I don't have an easy way to find/replace. I need to change 10/31 to 11/30 on every single page at once. I tried the command below but it didn't work. Obviously I don't know... (3 Replies)
Discussion started by: ijustsawmars
3 Replies

10. UNIX for Dummies Questions & Answers

Move A File With Same Date,don't Change The Desitination Dir Date

Assume, I created one file three years back and I like to move the file to some other directory with the old date (Creation date)? Is it possible? Explain? (1 Reply)
Discussion started by: jee.ku2
1 Replies
Login or Register to Ask a Question