Linux Dates, Times, Timezones, Day Light Saving

JamesBowen

19+ years progress programming and still learning.
Hi

Linux has a cool set of developer functions to calculate/get/set dates and times.

I was woundering if it's possible to access/call these functions within progress?I am using OE101B.

Basically I what to use the Linux Timezone info files so that I can calculate the Local time to UTC/GMT including Day Light Saving for any region in the world and also Calculate UTC back into Local Time.

Many Thanks.

P.S. I know JAVA has all this inbuilt, but once again how do I access/call java classes???
 
In addition to the above question does any body know how the read a Binary tzfile located in /usr/share/zoneinfo?

I have been doing some Google searches but not finding much.

James.
 
Thanks Tom, I have given zdump a try and it very interesting the result i get back and it could be very handy.

However the real problem that I am having is that I am developing a web application which interfaces with a 3rd party java application via common OE database and JDBC.

I need to set datetime and timezoneregions (i.e. Pacific/Auckland) to be the same as what the java application is expecting.

Has far as I know 3rd party Java application is using the common library of functions inbuilt into Java as listed here.

[SIZE=+2] Constructor Summary[/SIZE] TimeZone()
Sole constructor. [SIZE=+2] Method Summary[/SIZE] [SIZE=-1] Object[/SIZE] clone()
Creates a copy of this TimeZone. [SIZE=-1] static String[][/SIZE] getAvailableIDs()
Gets all the available IDs supported. [SIZE=-1] static String[][/SIZE] getAvailableIDs(int rawOffset)
Gets the available IDs according to the given time zone offset. [SIZE=-1] static TimeZone[/SIZE] getDefault()
Gets the default TimeZone for this host. [SIZE=-1] String[/SIZE] getDisplayName()
Returns a name of this time zone suitable for presentation to the user in the default locale. [SIZE=-1] String[/SIZE] getDisplayName(boolean daylight, int style)
Returns a name of this time zone suitable for presentation to the user in the default locale. [SIZE=-1] String[/SIZE] getDisplayName(boolean daylight, int style, Locale locale)
Returns a name of this time zone suitable for presentation to the user in the specified locale. [SIZE=-1] String[/SIZE] getDisplayName(Locale locale)
Returns a name of this time zone suitable for presentation to the user in the specified locale. [SIZE=-1] int[/SIZE] getDSTSavings()
Returns the amount of time to be added to local standard time to get local wall clock time. [SIZE=-1] String[/SIZE] getID()
Gets the ID of this time zone. [SIZE=-1] abstract int[/SIZE] getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds)
Gets the time zone offset, for current date, modified in case of daylight savings. [SIZE=-1] int[/SIZE] getOffset(long date)
Returns the offset of this time zone from UTC at the specified date. [SIZE=-1] abstract int[/SIZE] getRawOffset()
Returns the amount of time in milliseconds to add to UTC to get standard time in this time zone. [SIZE=-1] static TimeZone[/SIZE] getTimeZone(String ID)
Gets the TimeZone for the given ID. [SIZE=-1] boolean[/SIZE] hasSameRules(TimeZone other)
Returns true if this zone has the same rule and offset as another zone. [SIZE=-1] abstract boolean[/SIZE] inDaylightTime(Date date)
Queries if the given date is in daylight savings time in this time zone. [SIZE=-1] static void[/SIZE] setDefault(TimeZone zone)
Sets the TimeZone that is returned by the getDefault method. [SIZE=-1] void[/SIZE] setID(String ID)
Sets the time zone ID. [SIZE=-1] abstract void[/SIZE] setRawOffset(int offsetMillis)
Sets the base time zone offset to GMT. [SIZE=-1] abstract boolean[/SIZE] useDaylightTime()
Queries if this time zone uses daylight savings time.

Now is it possible to call the same classes/functions/methods from within the ABL?

As I will be doing many iterations I am trying to shell out named pipes.

James.
 
The source code is there so, depending on expertise, budget, and urgency, you could either try compiling it yourself for Linux ... hopefully contributing it back to OE Hive ... or you could contact John Green at Joanju.com who wrote it about getting him to compile and test it for you.
 
In case Thomas' comment was too obscure... DLL's are not a Windows-only technology. In the UNIX world they are called shared libraries or shared objects and you can access them from the 4GL starting with v9 using the same sorts of syntax that you use for Windows DLLs.
 
Update

Got to work this morning tried to recompile the jpjvm.cpp but I seam to have some include files missing. Also I am not sure what the parameters I need to the g++ command.
 
Back
Top