LinuxQuestions.org
Visit Jeremy's Blog.
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
 
Search this Thread
Old 07-14-2006, 07: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, 04:33 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,822
Blog Entries: 54

Rep: Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991
Code:
orderdate=$(env TZ=EST date '+%Y%m%d')
ordertime=$(env TZ=EST date '+%H%M%S')
 
Old 07-17-2006, 03: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


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


All times are GMT -5. The time now is 06:44 AM.

Main Menu
Advertisement
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