![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| time convert | b_manu78 | AIX | 10 | 3 Weeks Ago 10:47 AM |
| Convert milliseconds to standard time | chiru_h | Shell Programming and Scripting | 1 | 07-19-2007 10:45 AM |
| Setting TImezone fr Hong kong | Balamurugan | SUN Solaris | 1 | 02-10-2006 06:05 AM |
| Convert UTC time to Date | GNMIKE | Shell Programming and Scripting | 8 | 10-19-2005 11:43 PM |
| Convert from standard epoch time from a shell script? | LordJezo | Shell Programming and Scripting | 4 | 09-18-2005 08:48 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
hi friends,
this is my first time with this type of script so please pardon my ignorance. i have this script in which a piece of code needs to be added which can have the Asia/Hong kong time as well. system date and format is GMT so no problem with GMT and even EST is covered..i have ato add new File watchers and that requires an update to the following script to support Asia time as well. #!/bin/sh LOGS=/etdhub-as1/apps/home/pcent/informatica/logs EDATE=`date "+%Y%m%d_%T"` BIN=/etdhub-as1/apps/home/pcent/informatica/Scripts UNIXSERVER=etdhub-as1-p.prd.etsd.ml.com ETC=/etdhub-as1/apps/home/pcent/etc TMP=/etdhub-as1/apps/home/pcent/tmp export LOGS EDATE BIN UNIXSERVER ETC TMP WOMBATDIR=/gfs/data/.../prod/wombatsymbolfiles/1.0 SRCDIR=/gffgf/apps/home/pcent/informatica/SrcFiles/OPTIONS_Delivery ROPADIR=/gfs/data/sss/prod/ropa/1.0 LIFDIR=/gfs/data/sss/raw/liffe FOWDIR=/gfs/data/sss/prod/fowtradedata GMTDATE=`date "+%Y%m%d"` GDATE=`date "+%Y%m%d_%T"` GYEAR=`date "+%Y"` GMONTH=`date "+%m"` GDD=`date "+%d"` TAIWANDIR=/gfs/data/sss/raw/taiwandata TDATE=`date "+%Y%m%d"` TYEAR=`date "+%Y"` TMONTH=`date "+%m"` TDD=`date "+%d"` export WOMBATDIR SRCDIR ROPADIR GDATE GYEAR GMONTH GDD FOWDIR LIFDIR GMTDATE TAIWANDIR TDATE TYEAR TMONTH TDD STOCKLOANDIR=/gfs/data/sss/raw/stockloan SDATE=`date "+%Y%m%d"` SYEAR=`date "+%Y"` SMONTH=`date "+%m"` SDD=`date "+%d"` any help would be much appreciated.. |
| Forum Sponsor | ||
|
|
|
|||
|
IF you on a POSIX compliant system you can use the TZ variable. This machine is CST.
It doesn't have a TZTAB entry (HPUX thing for timezones) for Hong Kong but it doesn't matter. I am assuming HK is UTC+8: Code:
csadev:/home/jmcnama> date +%c Wed Mar 19 11:49:58 2008 csadev:/home/jmcnama> echo $TZ CST6CDT csadev:/home/jmcnama> TZ=HST-8HST csadev:/home/jmcnama> date +%c Thu Mar 20 00:51:52 2008 |
|
|||
|
if I have to change it form GMT would it still be "TZ=HST-8HST" or "TZ=HST-7HST" since the day light time came into effect?
Otherwise it works...Really eally appreciate it...... |
|
|||
|
you didn't specify which OS your using, so you'd want to doublecheck what
the timezone entry is for Hongkong, just to be safe. Solaris is TZ=Hongkong if I have to change it form GMT would it still be "TZ=HST-8HST" or "TZ=HST-7HST" since the day light time came into effect? No, the system will know how to compensate for EST or DST with the default entry. PS: Hongknog does not use day light saving time! |
|||
| Google The UNIX and Linux Forums |