Author: apatel
Date: Tue Aug 7 13:30:17 2007
New Revision: 563645
URL:
http://svn.apache.org/viewvc?view=rev&rev=563645Log:
Improved timestamp parsing using utility method.
Modified:
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java?view=diff&rev=563645&r1=563644&r2=563645==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java Tue Aug 7 13:30:17 2007
@@ -386,26 +386,8 @@
}
String datetimeReceived = UtilXml.childElementValue(receiptLnElement, "os:DATETIMEISO");
- Date dateTimeInvReceived = null;
- Timestamp timestampItemReceived = null;
- try{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSS'Z'Z");
- dateTimeInvReceived = sdf.parse(datetimeReceived);
- }catch(ParseException e){
- Debug.logInfo("Message does not have timezone information in date field", module);
- try{
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSS'Z'");
- dateTimeInvReceived = sdf.parse(datetimeReceived);
- }catch(ParseException e1){
- String errMsg = "Error parsing Date: " + e1.toString();
- errorMapList.add(UtilMisc.toMap("reasonCode", "ParseException", "description", errMsg));
- Debug.logError(e, errMsg, module);
- }
- }
- if(dateTimeInvReceived !=null){
- timestampItemReceived = new Timestamp( dateTimeInvReceived.getTime() );
- ripCtx.put("datetimeReceived", timestampItemReceived);
- }
+ Timestamp timestampItemReceived = OagisServices.parseIsoDateString(datetimeReceived, errorMapList);
+ ripCtx.put("datetimeReceived", timestampItemReceived);
// Check reference to PO number, if exists
GenericValue orderHeader = null;
if(orderId != null) {