When we are importing the date from xml to AIF we cannot convert that string to date using str2date().
The following function is used to convert from str to date.
Date ConvertXMLStrToDate(str _xmlValue)
{
System.DateTime netDttm;
str strTransDateTime;
utcdatetime TransDateTime;
;
new InteropPermission(InteropKind::CLRInterop).assert();
netDttm = System.DateTime::Parse(_xmlValue);
TransDateTime=Global::utcDateTime2SystemDateTime(netDttm);
return dateTimeUtil::date(TransDateTime);
}
Call from job
static void krishh_ConvertXmlStrToDate(Args _args)
{
date datevar;
System.DateTime netDttm;
str strTransDateTime;
utcdatetime TransDateTime;
EDSA_CreateSalesOrder createsales;
;
createsales=new EDSA_CreateSalesOrder();
strTransDateTime='2011-08-25 00:00:00';
datevar=createsales.ConvertXMLStrToDate(strTransDateTime);
}
The following function is used to convert from str to date.
Date ConvertXMLStrToDate(str _xmlValue)
{
System.DateTime netDttm;
str strTransDateTime;
utcdatetime TransDateTime;
;
new InteropPermission(InteropKind::CLRInterop).assert();
netDttm = System.DateTime::Parse(_xmlValue);
TransDateTime=Global::utcDateTime2SystemDateTime(netDttm);
return dateTimeUtil::date(TransDateTime);
}
Call from job
static void krishh_ConvertXmlStrToDate(Args _args)
{
date datevar;
System.DateTime netDttm;
str strTransDateTime;
utcdatetime TransDateTime;
EDSA_CreateSalesOrder createsales;
;
createsales=new EDSA_CreateSalesOrder();
strTransDateTime='2011-08-25 00:00:00';
datevar=createsales.ConvertXMLStrToDate(strTransDateTime);
}