Sponsored Content
Operating Systems Solaris Setting timezone Sunos 5.8 & adjusting Post 302188900 by jlliagre on Thursday 24th of April 2008 01:28:30 PM
Old 04-24-2008
You missed to understand the previous reply.

You never change the system clock timezone on Unix. It is always UTC (a.k.a. GMT).

The way the clock is *displayed* depends on the environment variable TZ and so can vary on a per process basis. To view the correct timezone in your shell, just run:
Code:
TZ=US/Eastern
export TZ
date

If you want the default timezone to be set, you'll need to reboot.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

What is the difference : SunOS & Solaris Version.

Sorry I think someone already pointed out this but I couldn't find it. Please tell me what is the difference between SunOS Version and Solaris Version. What is the purpose of maintaining these two things ? Thanks (2 Replies)
Discussion started by: champion
2 Replies

2. UNIX for Advanced & Expert Users

Migration of binary file from Sunos 5.8 to Sunos 5.9

I have compiled binary file using "cc" on SunOS 5.8 and the same binary file i have copied to SunOS 5.9 and it is giving me core dump error.I want to know whether migration of compiled code from lower version to higer version created this problem. how can i solve this problem.I am pasting the core... (1 Reply)
Discussion started by: Arvind Maurya
1 Replies

3. Solaris

Setting TImezone fr Hong kong

Hi, In solaris how to change the timezone to display to HKT I tried by putting TZ=Hongkong or TZ=Asia/Hong_kong but it is taking me to the display of CST. how to change it to HKT thanks Bala (1 Reply)
Discussion started by: Balamurugan
1 Replies

4. Solaris

SunOS 5.6: timezone data patch

Does anyone know if there is a patch for SunOS 5.6 timezone update for new daylight savings times. I have looked and have updated my 5.8 machine. Can not find one for 5.6. I still use one box for a certian piece of hardware that can not use the newer versions. (6 Replies)
Discussion started by: vacomman
6 Replies

5. Shell Programming and Scripting

Adjusting the output in a file

QUERY SCENARIO Here is the actual scenario LOOP echo "$COLNAME $TYPENAME($LENGTH) $NULLS ">>$DDL_FILE END-LOOP COLNAME, TYPENAME, LENGTH, NULLS are the variables and within echo statment the output of which has to go into file specified by DDL_FILE. ... (1 Reply)
Discussion started by: skyineyes
1 Replies

6. AIX

Timezone Setting

Hi On several AIX 5.3 LPARs the timezone is currrently set to: TZ=NZST-12NZDT,M9.5.0/02:00,M4.1.0/03:00 Daylight savings in NZ starts on Sun 28th Sep 2008, which is the fourth Sunday. Do I need to change my TZ variable to NZST-12NZDT,M9.4.0/02:00,M4.1.0/03:00 or will AIX interpret the fifth... (2 Replies)
Discussion started by: KiwiP
2 Replies

7. UNIX and Linux Applications

Setting vi indentation to k&r style?

A bit of searching on Google did not seem to yield any really helpful results on how to set vim to use k&r indentation style. I know Emacs has such a feature, but does vim? If so, how do I turn it on? I am just starting to learn vi, and when I am coding in C it looks really ugly without some sort... (2 Replies)
Discussion started by: kermit
2 Replies

8. Programming

adjusting a code for Linuxconio.h

Hi All, I am using a book to learn C++. Unfortunately the book, sometimes, uses the maddening phrase, #include <conio.h>, which is a M$ related file and not a part of STL, in some of its examples. My question is: How would you modify the following code so it would compile and run on Linux?... (3 Replies)
Discussion started by: eager2no
3 Replies

9. Shell Programming and Scripting

Adjusting Dates

What is the easiest way to find the date 6 month prior to the current date. Example: Today is 2011/01/29 I need to find the 1st day of the month, 6 month ago, which is 2010/08/01. I have to count 1/1/2011 as a previous month, since the current day is past 1/1/2011. Is there any easy... (4 Replies)
Discussion started by: jclanc8
4 Replies

10. Solaris

Setting up Solaris & ZFS for the first time

Hello All I’ve made the decision to switch my storage server from FreeNAS to Solaris. I opted to use FreeNAS as it has ZFS and until BTRFS is stable, it’s the best option (IMHO) for backup and network storage. The switch was facilitated by the USB stick that FreeNAS was on got lost during a... (1 Reply)
Discussion started by: BlueDalek
1 Replies
gettimeofday(3UCB)				     SunOS/BSD Compatibility Library Functions					gettimeofday(3UCB)

NAME
gettimeofday, settimeofday - get or set the date and time SYNOPSIS
/usr/ucb/cc [ flag ... ] file ... #include <sys/time.h> int gettimeofday(tp, tzp) struct timeval *tzp; struct timezone *tzp; int settimeofday(tp, tzp) struct timeval *tzp; struct timezone *tzp; DESCRIPTION
The system's notion of the current Greenwich time is obtained with the gettimeofday() call, and set with the settimeofday() call. The cur- rent time is expressed in elapsed seconds and microseconds since 00:00 GMT, January 1, 1970 (zero hour). The resolution of the system clock is hardware dependent; the time may be updated continuously, or in clock ticks. long tv_sec; /* seconds since Jan. 1, 1970 */ long tv_usec; /* and microseconds */ tp points to a timeval structure, which includes the following members: If tp is a NULL pointer, the current time information is not returned or set. tzp is an obsolete pointer formerly used to get and set timezone information. tzp is now ignored. Timezone information is now handled using the TZ environment variable; see TIMEZONE(4). Only the privileged user may set the time of day. RETURN VALUES
A -1 return value indicates an error occurred; in this case an error code is stored in the global variable errno. ERRORS
The following error codes may be set in errno: EINVAL tp specifies an invalid time. EPERM A user other than the privileged user attempted to set the time. SEE ALSO
cc(1B), adjtime(2), ctime(3C), gettimeofday(3C), TIMEZONE(4) NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system libraries or in multi-thread applications is unsupported. tzp is ignored in SunOS 5.X releases. tv_usec is always 0. SunOS 5.11 30 Oct 2007 gettimeofday(3UCB)
All times are GMT -4. The time now is 03:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy