![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| changing date | manoj.solaris | Linux | 1 | 09-12-2007 04:27 PM |
| Changing Creation Date to a Prespecified Date of a File In Unix | monkfan | UNIX for Dummies Questions & Answers | 4 | 11-28-2006 07:15 AM |
| changing the format of date | nasirgondal | Post Here to Contact Site Administrators and Moderators | 1 | 06-08-2006 01:37 AM |
| Linux sys date changing | nikk | UNIX for Advanced & Expert Users | 1 | 06-23-2002 08:19 PM |
| changing the date | JBX | UNIX for Dummies Questions & Answers | 2 | 09-13-2001 08:23 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Changing the date to EST
Hi,
The unix box has a system date in the PDT time zone format..if i need to capture the value of the date in a variable id do this: orderdate=`date '+%Y%m%d'` ordertime=`date '+%H%M%S'` output : $orderdate= 20060714 $ordertime= 043438 I need to convert and store this orderdate and ordertime to EST format.Is there any functions that let me get the EST timezone value instead of jst adding 3 hours??? |
|
||||
|
The environment variable TZ can be used to change the timezone temporarily
I'm assuming you are in the Pacific timezone (TZ="PST8PDT") in this code snippet: Code:
#!/bin/ksh oldTZ="$TZ" export TZ="EST5EDT" orderdate=`date '+%Y%m%d'` ordertime=`date '+%H%M%S'` export TZ="$oldTZ" |
|
||||
|
thanks worked perfectly
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|