Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accepting the date on the system 1

Status
Not open for further replies.

SiouxCityElvis

Programmer
Jun 6, 2003
228
US
I'm using RMCOBOL-85 on Linux...
How do I fix the date showing up as what I believe must be GMT since it's usually 5-6 hours off my local time. At a prompt when I type the linux command "date", the time shows up as my local time, but in my COBOL it shows up as the GMT time I guess.

In my working storage:
Code:
01  HISTDATE.
    03 HCC  PIC 99.
    03 HYY  PIC 99.
    03 HMM  PIC 99.
    03 HDD  PIC 99.

In my procedure division.
....
Code:
ACCEPT HISTDATE FROM YYYYMMDD.
DISPLAY HISTDATE.

Thanks.
-David

 
David,

prior to execution of the cobol program, the standard TZ environment variable must be set. For example, in the bash shell for the US Central time zone, try the following:
Code:
export TZ="US/Central"
Other shells require different syntax, but the idea is the same.

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top