LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 07-14-2006, 06:42 AM   #1
shiroh_1982
LQ Newbie
 
Registered: May 2006
Posts: 9

Rep: Reputation: 0
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???
 
Old 07-15-2006, 03:33 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,534
Blog Entries: 51

Rep: Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604Reputation: 2604
Code:
orderdate=$(env TZ=EST date '+%Y%m%d')
ordertime=$(env TZ=EST date '+%H%M%S')
 
Old 07-17-2006, 02:06 AM   #3
shiroh_1982
LQ Newbie
 
Registered: May 2006
Posts: 9

Original Poster
Rep: Reputation: 0
thanks worked perfectly
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the date slowly mearley Linux - Newbie 2 12-31-2004 05:07 AM
Changing the date mad_ady Solaris / OpenSolaris 3 12-19-2004 03:50 PM
xwindows not updating screen after changing date nacide Linux - Newbie 1 06-30-2004 08:35 AM
Remote Date Changing mriolo Linux - General 11 02-25-2003 07:35 PM
Date Changing mriolo Linux - Networking 1 02-24-2003 02:50 PM


All times are GMT -5. The time now is 09:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration