time in other places

time in other places

Post by Jamie Ch » Tue, 22 Feb 1994 18:11:49



Hi,

        I find out local time by punching in "date".  How can I find out
time in other places? say, Hongkong?
Thanks

--
+--------------------------------------------------------------+
|  Jamie Chui  =)               |  Research is what I am doing |

|                               |  what I am doing.            |

 
 
 

time in other places

Post by Colin Kenda » Thu, 24 Feb 1994 02:48:29


        > Hi,

        >    I find out local time by punching in "date".  How can I find out
        > time in other places? say, Hongkong?

1. Fly to Hong Kong.

2. Punch in "date".

Hope this helps.

--
Warmest regards,
Colin Kendall.
Phone (813) 371-0811 extension 6842

 
 
 

time in other places

Post by Ray Jon » Thu, 24 Feb 1994 08:55:06




>    > Hi,
>    >    I find out local time by punching in "date".  How can I find out
>    > time in other places? say, Hongkong?

[idiotic post deleted]

If you know the time zone of the place of interest:
 For timezone 5 (Eastern Standard Time)
 (TZ=5;date)
Gives Tue Feb 22 15:52:02 PST 1994
 For timezone 8 (Pacific Standard Time)
 (TZ=8;date)
Gives Tue Feb 22 15:52:06 PST 1994

Note: The parens are important ()
--

Ray A. Jones; Celestial Software       | spelling errors in this missive
8545 S.E. 68th Street                  | approaches unity. If this bothers you,
Mercer Island, WA 98040;(206) 236-1676 | run it through your spell checker!

 
 
 

time in other places

Post by Jamie Ch » Thu, 24 Feb 1994 19:11:04



>Hi,
>    I find out local time by punching in "date".  How can I find out
>time in other places? say, Hongkong?
>Thanks
>--
>+--------------------------------------------------------------+
>|  Jamie Chui  =)           |  Research is what I am doing |

>|                           |  what I am doing.            |

Yes, me again.
After consulting the book "Unix Power Tool", I finally figured out how to
set the TZ thing.
first, in /usr/share/lib/zoneinfo , I found that the timezone for
Hongkong is just Hongkong.
Then, I added the following line into my .cshrc file:

alias hk '(setenv TZ Hongkong; date)'

It works! I just type "hk", then the Hongkong time will show up.
By the way, "Unix Power tools" is a great book for intermediate level
users.  I just got it today. It's published by the O'reilly &
Associates.

--
+--------------------------------------------------------------+
|  Jamie Chui  =)               |  Research is what I am doing |

|                               |  what I am doing.            |

 
 
 

time in other places

Post by Guy Harr » Fri, 25 Feb 1994 08:36:55


Quote:>If you know the time zone of the place of interest:
> For timezone 5 (Eastern Standard Time)
> (TZ=5;date)
>Gives Tue Feb 22 15:52:02 PST 1994
> For timezone 8 (Pacific Standard Time)
> (TZ=8;date)
>Gives Tue Feb 22 15:52:06 PST 1994

>Note: The parens are important ()

1) TZ=8 is a Bourne-shell-ish syntax; if you have a Bourne-compatible
   shell, you could do

        TZ=8 date

   with no parentheses.

   This is a general trick; you can run a command with various
   environment variables temporarily set to other values, e.g.

        TERM=fnork command

   to run "command" with TERM set to some value other than its current
   value.

   If you do *not* have a Bourne-compatible shell, you may have to do
   something such as

        (setenv TZ 8; date)

   (except that you wouldn't use "8", you'd use something else; see the
   next three items, which explain why "8" isn't the right setting).

2) The correct very-old-style time zone syntax is *not* just the offset
   from UTC in hours, it's more like "PST8PDT" for Pacific time, so
   you'd have to do

        TZ=PST8PDT date

   to get Pacific time and

        TZ=EST8EDT date

   to get Eastern time.

3) The above means that the rules for when daylight savings time/summer
   time starts and ends may be the "default" rules on your system, and
   may not be correct for some other time zone.  There is a somewhat
   rococo syntax adopted in System V Release 3.1 or so, and an even
   *more* rococo syntax adopted by POSIX, for putting the rules into the
   TZ setting.

4) If you have a system with a *good* time zone implementation, you
   probably have with with the Arthur Olson code, which puts the rules
   in files, where they belong, rather than in TZ itself.  For example,
   in systems that have the Olson code and the right time zone files,

        TZ=Hongkong date

   will do (assuming that the Hong Kong rules on your system are correct).

 
 
 

time in other places

Post by Kelly Fenner (STD CONTR|jkei » Sun, 27 Feb 1994 03:40:47



|>
|>   > Hi,
|>
|>   >    I find out local time by punching in "date".  How can I find out
|>   > time in other places? say, Hongkong?
|>
|> 1. Fly to Hong Kong.
|>
|> 2. Punch in "date".
|>
|>
|>
|> Hope this helps.
|>
|> --
|> Warmest regards,
|> Colin Kendall.
|> Phone (813) 371-0811 extension 6842

Gotta love the sarcastic humor on newsgroups....

Kelly
--
*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*

Engineering: "How will this work?"  |                           *
Science: "Why will this work?"      |                           *
Management: "When will this work?"  |     (410)278-6724         *
Liberal Arts:                       |                           *
 "Would you like fries with that?"  |     Bldg. 328 Rm.3        *
                                    | APG, Aberdeen, MD 21005   *
*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*

 
 
 

time in other places

Post by Wojtek Swiat » Sat, 26 Feb 1994 21:47:55


:       I find out local time by punching in "date".  How can I find out
: time in other places? say, Hongkong?

If you know the address of the computer you want to get the time
from, juste do a
telnet <computer> 13
This will give you the time on that computer.

A more elegant solution is to use the rdate tool (look for it
with archie). Easy and nice.

If you use XWindows, have a look at xchrono - you'll have all
the times you wish displayed at one time :)

Hope this helps,
Wojtek
 --------------------------------------------------------------------
| Wojtek Swiatek, AGH, Dept. of High-Energy Physics, Krakow, Poland  |
|                 CERN, Geneva, Switzerland    DESY, Hamburg, DE     |



 --------------------------------------------------------------------
 GS(GSC) c++(++++) u++(-) e++ m+ s+/ n++ h(++) f g+ t r+

 
 
 

time in other places

Post by Hans Henrik Eriks » Tue, 01 Mar 1994 16:47:47



>   This is a general trick; you can run a command with various
>   environment variables temporarily set to other values, e.g.

>    TERM=fnork command

>   to run "command" with TERM set to some value other than its current
>   value.

  The only command this doesn't work for is eval, which contaminates
  the environment:

  WHO=world eval : ; echo hello $WHO

  produces hello world while

  (WHO=world; export WHO; eval :) ; echo hello $WHO

  (which should be equivalent according to POSIX etc.),
  produces just hello [if $WHO was empty before].

  This bug is present in all versions of the Bourne shell that I have
  access to...

  Hans Henrik Eriksen

 
 
 

time in other places

Post by Part » Wed, 02 Mar 1994 20:49:14



Quote:>   WHO=world eval : ; echo hello $WHO
>   produces hello world while
>   (WHO=world; export WHO; eval :) ; echo hello $WHO
>   (which should be equivalent according to POSIX etc.),
>   produces just hello [if $WHO was empty before].
>   This bug is present in all versions of the Bourne shell that I have

Are you sure that this is a bug? I thought it was a feature (changes
made in the subshell or in any child process are never propagated to the
parent).

--

EDV-Zentrum, Universitaet fuer Bodenkultur
Nussdorfer Laende 11                      Please correct me if I'm wrong!
A-1190 Wien, Austria (Europe)             Make love, not flame wars.  :-)

 
 
 

1. Best place to place shell scripts for all users to have access

The subject line just about says it all really. Is there a standard
directory for shell scripts?

Also if I call script B from script A where both use the same shell,
that is the first line is something like:

#! /bin/bash

Does script B load a new shell or does it recognise that the required
shell is currently active?
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bob Wightman

2. How to disable password for a account in Solaris 2.3?

3. Can I prevent pinging from others and still ping others?

4. mklinux-pa-risc-hppa-mklinux-? HP Linux, Answers please.

5. one child having more cpu time than others

6. X has died

7. Hoaxes -- "Good Times" and others

8. Xsun without dtlogin under sun solaris 2.7

9. Placing time limits on reads and other system calls

10. Saving Time For Erik And Others

11. redirecting stdio/err many times to many places

12. Extreme response times for telnet, ftp and others

13. Looking for a scheduling program for time and places for Linux