iamdnb
20th July 2008, 12:11
Hi,

I am working on a project with a requirement to convert the date as per ISO-8601 format for which I have to find the TZD (Time Zone Designator) i.e. the difference between the user's time zone and GMT.

I could not find any ready function to find the same. I will appreciate if someone could suggest some function in Baan which could be used to calculate the TZD.

Davendra :confused:

NPRao
21st July 2008, 00:23
I found the functions in the LN Tools versions, I am not sure if its available in Baan-5 series, you have to check with the Baan Support.

iso.to.utc()
Syntax:
function long iso.to.utc (const string iso.string)

Description
This converts a string, representing a time in ISO-8601 format into a utc.

Arguments
const string iso.string

Return values
>0 The UTC long format value.
<0 Error.

Context
This function can be used in all script types.

utc.to.iso()
Syntax:
function string utc.to.iso (string utc, long format)

Description

This converts a utc into a string representation of the utc in ISO8601 format.

Arguments
string utc
long format Can be one of the following constants:

UTC_ISO_DIFF with time-zone "yyyy-mm-ddThh:mm:ss + hh:mm" or

"yyyy-mm-ddThh:mm:ss - hh:mm"
UTC_ISO_Z as GMT "yyyy-mm-ddThh:mm:ssZ"
UTC_ISO_LOCAL with as local date/time "yyyy-mm-ddThh:mm:ss

Return values
The string representation of the UTC in ISO-8601 format.

Context
This function can be used in all script types.

iamdnb
23rd July 2008, 18:50
Thanks NPRao (Guru).

Unfortunately, the functions mentioned by you are not available in BaaN V. Anyways, I had to write my own functions to achieve the results. I am attaching the source for both functions iso.to.utc() and utc.to.iso() for everybody's reference.

Thanks for the support.

Regards
Davendra

baanhp
10th October 2012, 12:47
Dear Sir,

The same requirement is in BAAN iv,unfortunately your code is not working in BAAN iv,because the standard function get.time.zone() function and date.to.date() functions are not working in BAAN IV .

Kindly guide me some alternative way to code in BAAN IV



Thanks for your valuable help in advance .



Regards
Haraprasad