cancel
Showing results for 
Search instead for 
Did you mean: 

serious date/time problems in Alfresco

roli8200
Champ in-the-making
Champ in-the-making

I recognized some serious date/time problems in Alfresco.

1: Alfresco completely ignores the local timezone. Even when set -Duser.timezone=Europe/Zurich in JAVA_OPTS in catalina.sh, it sets dates always as Zulu (UTC)

2: The informations in: Date and time format | Alfresco Documentation  are partially wrong.

These dates are only applicable for fields like Creation Date or Last Modified Date

3: When I make a custom aspekct with a property of type date, it always sets the wrong date from date picker.

I set (iso) 2017-05-10, the CMIS query for that date field shows me 2017-05-09T22:00.00.000Z (see also #2,#1)

which is completely wrong and a huge problem, specially because this date should be furter processed by downstream processes via CMIS.

Can someone from alfresco please take care of all that problems and fix the date/time processing routines in Alfresco?

I know Oracle/Sun made serious bugs the (in the meantime) several date/time apis in Java, specially the last one in Java 8 

is a declaration of bankruptcy by Oracle.

Maybe some diffrent java apis are in use by diffrent components which are incompatible. 

13 REPLIES 13

My solution was easy but not nice. I find out that d:date property has internally also information about time. Search works as I expected when I set a value of hour in this property to more then 2. 

So I created a rule which calls a js script after document creation or update. This script reads d:date property and sets its hour to value which works (I set value 9).

Can you share the js script code ?  i'm a little slow with dates XD

I used this code:

var date = document.properties['myDoc:myDateProp'];
if(date!=null){  
  date.setHours(9);  
  document.properties['myDoc:myDateProp'] = date;  
  document.save();
}

sanjaybandhaniya
Elite Collaborator
Elite Collaborator

I have also same question.