PDT to IST in COBOL.
-
- Registered Member
- Posts: 27
- Joined: Tue Aug 20, 2013 11:32 am
PDT to IST in COBOL.
Hii All,
I wanted to convert my current time stamp to india time zone stamp. Like PDT to IST.
Can any one help me. My current timestamp is PDT (US ) in my system. Now I have to populate indian time.
I wanted to convert my current time stamp to india time zone stamp. Like PDT to IST.
Can any one help me. My current timestamp is PDT (US ) in my system. Now I have to populate indian time.
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: PDT to IST in COBOL.
Assuming you meant on this forum and not on your mainframe, go to the User Control Panel, click on the Board Preferences tab, and change the time zone there. Don't forget to Save your change.
- Anuj Dhawan
- Founder
- Posts: 2824
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: PDT to IST in COBOL.
Subject line mentions about COBOL, I doubt it's to do with Forum!? 

Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: PDT to IST in COBOL.
The easiest way is to adjust manually the date / time.
However, Language Environment (LE) has CEEFTDS and CEESETL run time functions which may accomplish what you want -- I haven't tested them so I'm not aware of how they work nor what they return. You may want to look through https://www-01.ibm.com/servers/resource ... 0_v2r3.pdf to see if what you want can be done through LE.
However, Language Environment (LE) has CEEFTDS and CEESETL run time functions which may accomplish what you want -- I haven't tested them so I'm not aware of how they work nor what they return. You may want to look through https://www-01.ibm.com/servers/resource ... 0_v2r3.pdf to see if what you want can be done through LE.
-
- Registered Member
- Posts: 27
- Joined: Tue Aug 20, 2013 11:32 am
Re: PDT to IST in COBOL.
In that how do I take care about the day light saving?enrico-sorichetti wrote: ↑Thu Aug 02, 2018 12:12 amadd/subtract the appropriate time zone correction factor
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: PDT to IST in COBOL.
If you are talking about, specifically, PDT to IST then you merely need to know the dates for going to (second Sunday in March) and returning from (first Sunday in November) daylight savings time each year; if the date you are looking at is within the daylight savings time window you adjust for it. Since the local time goes forward an hour in March and goes back an hour in November, your adjustment will be one hour. Since IST is GMT+5:30 and PST is GMT-8 (and PDT is GMT-7), you merely have to add 12 hours 30 minutes (for PDT) or 13 hours 30 minutes (for PST) to the time to convert to IST. This may require adjusting the date, of course.
The general case is much harder, since not all parts of the US use daylight savings time (the states of Arizona and Hawaii and the US possessions, notably -- although the Navajo Nation part of Arizona does observe daylight savings time). And some of the states are split between time zones.
The general case is much harder, since not all parts of the US use daylight savings time (the states of Arizona and Hawaii and the US possessions, notably -- although the Navajo Nation part of Arizona does observe daylight savings time). And some of the states are split between time zones.
-
- Registered Member
- Posts: 27
- Joined: Tue Aug 20, 2013 11:32 am
Re: PDT to IST in COBOL.
Thanks. I had to do it manually. But is there no in-built function in COBOL at all?
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: PDT to IST in COBOL.
Why not check the Enterprise COBOL Language Reference manual yourself? If you do, you will discover that there are some date-related intrinsic functions but there are NO time-related intrinsic functions. So the answer to your question is that there are plenty of built-in functions in COBOL, but none of them deal with time or time offsets.But is there no in-built function in COBOL at all?
-
- Registered Member
- Posts: 27
- Joined: Tue Aug 20, 2013 11:32 am
Re: PDT to IST in COBOL.
Thanks Robert. I was working at a company where they had a common routine whcih was used to do something very similar which I required. But I have used that module for date conversion, like Gregorian to Julian, vice versa on many other formats. It allowed to change the time also. But I think it was written by someone in that company only.
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: PDT to IST in COBOL.
Yes, such routines are pretty common at mainframe sites. They were typically written to meet the site's specific needs and hence you have to adapt to the new routine as you move from site to site.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute