How to set correct timezone and date?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to set correct timezone and date?
# 1  
Old 03-17-2010
How to set correct timezone and date?

Hi all.
I changed the date to go ahead one hour for DST this past weekend and date command shows:

Code:
 
 
[rcworarpt] /home/oracle>date
Wed Mar 17 12:40:12 EST 2010
 
[rcworarpt] /home/oracle>echo $TZ
Canada/Eastern

I think it should be reading EDT and not EST as My Dataprotector is reporting backups at one hour ahead... The server that Dataprotector runs on is set correctly.

Any thoughts or suggestions?

Thanks
# 2  
Old 03-17-2010
you may want to check and modify (IF REQUIRED), the /etc/TIMEZONE file
# 3  
Old 03-17-2010
TIMEZONE file:

Code:
 
#ident  "@(#)init.dfl   1.6     00/05/27 SMI"
#
# This file is /etc/default/init.  /etc/TIMEZONE is a symlink to this file.
# This file looks like a shell script, but it is not.  To maintain
# compatibility with old versions of /etc/TIMEZONE, some shell constructs
# (i.e., export commands) are allowed in this file, but are ignored.
#
# Lines of this file should be of the form VAR=value, where VAR is one of
# TZ, LANG, CMASK, or any of the LC_* environment variables.
#
TZ=Canada/Eastern
CMASK=022
LC_COLLATE=en_CA.ISO8859-1
LC_CTYPE=en_CA.ISO8859-1
LC_MESSAGES=C
LC_MONETARY=en_CA.ISO8859-1
LC_NUMERIC=en_CA.ISO8859-1
LC_TIME=en_CA.ISO8859-1

# 4  
Old 03-17-2010
Which version of Solaris is it ?
If you had provided the date and time zone details correctly during the install, then the system would have automatically moved the time. Unless if its Solaris 8 or old kernel versions of Solaris-9 before 2007.
In that Scenario you will need a DST patch.
# 5  
Old 03-18-2010
I think you may be right about the DST patch:

Code:
 
[rcworarpt] />uname -a
SunOS rcworarpt 5.9 Generic_112233-07 sun4u sparc SUNW,Sun-Fire-480R

# 6  
Old 03-18-2010
Quote:
I changed the date to go ahead one hour for DST this past weekend and date command
In general, do not ever change the actual date with the date command, which it sounds like you did, in order to adjust for DST.

I'm guessing your internal system clock is now one hour fast, i.e., UTC-1.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Date: invalid date trying to set Linux date in specific format

i try to set linux date & time in specific format but it keep giving me error Example : date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" or date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" keep giving me this error : date: invalid date ‘19-01-2017 00:05:01' Please use CODE tags... (7 Replies)
Discussion started by: umen
7 Replies

2. Shell Programming and Scripting

Date not correct so it changed to current date.

Hello, so basically i have a txt file containing "foto's" named YYYY-MM-DD_HH.mm.ss.jpeg. But since it can probably not convert it it changes the date to the current date. What am i doing wrong? #!/bin/bash inputDateFmt() { sed -e 's/_/ /g' -e 's/\./:/g' <<< "$1" } begindatum=$(date... (3 Replies)
Discussion started by: Rovester
3 Replies

3. SCO

Cannot use 'date -t' to set the system date and time

Hi! All, I am trying to reset the date and time since the change in time over the weekend. I cannot issue the command date -t 201703131330. The system gives me an error invalid option. This happens on my SCO OpenServer 5.0.7 and 5.0.6. Do anyone have an idea why? I even tried using... (6 Replies)
Discussion started by: trolley
6 Replies

4. Shell Programming and Scripting

Timezone and date +%s command

DST started on Oct 20th in Brazil. If I run the below command in that time zone, date +%s -d "10/20/2013" it throws an error message "Invalid date" . But it works fine for other dates including 19th and 21st Oct. Any idea ? Is there any unix patch ? (2 Replies)
Discussion started by: Lakshmikumari
2 Replies

5. Programming

Normalizing date value to a single timezone

Hi, Am trying to get a normalized date value irrespective of the time zone of the machine in which following code is run. When the following code is run in 2 different machines with TZ=UTC and TZ=PDT, I get 2 different values. I simply want to normalize the output that is specific to a... (3 Replies)
Discussion started by: matrixmadhan
3 Replies

6. Shell Programming and Scripting

How to check if date format is correct?

Hi! how do i know if the input is the same as the required date format? the date should be dd/mm/YYYY ex. 2/3/2012 or 15/11/2012 all the following conditions must return an error: *input of string *day is > 31 or < 1 *month is > 12 or < 1 *year is < 2013 suppose the date format is stored... (1 Reply)
Discussion started by: angilulu
1 Replies

7. Red Hat

when users ftp to server the timezone reflected is UTC but the server is set to TZ in localtime

Guys, Need your help coz my server runs in local time GMT +8, but when client use ftp and login, the resulting timestamp seen in each file is in UTC format. We need to set that the time should be the same as GMT +8 when in ftp session. I am using RHEL 5.3. root@]# ll total 1740... (2 Replies)
Discussion started by: shtobias
2 Replies

8. Shell Programming and Scripting

Exit if date not in correct format

Can somone take a look at this script for me - I'm trying to get it to exit if the format of dateToLookFor is not in the format YYYYMMDD: function search { cd $logsloc echo "Enter date in format YYYYMMDD (enter to exit):" read dateToLookFor echo $dateToLookFor | grep -q ... (2 Replies)
Discussion started by: rich@ardz
2 Replies

9. Shell Programming and Scripting

if [ $NOWDATE -gt $STARTDATE ] , date comparison correct syntax?

i've looked at a bunch of the date comparison threads on these boards but unfortunately not been able to figure this thing out yet. still confused by some of the way conditionals handle variables... here is what i where i am now... # a bunch of initializition steps are here ...... (1 Reply)
Discussion started by: danpaluska
1 Replies

10. Shell Programming and Scripting

Check for the correct date format in UNIx

Hi All, I am getting two input from User for Date from the command prompt when my script is executed . The date format i am taking is : DD-MM-YYYY so is there any method in Unix to validate the two input date. There might be many cases for these two date to be invalid.... (1 Reply)
Discussion started by: rawatds
1 Replies
Login or Register to Ask a Question