How to convert a date in this format (Tue Jul 13 00:00:00 CEST 2010) to a Java Date (The string comes from an alfresco property)

后端 未结 5 619
孤街浪徒
孤街浪徒 2020-11-30 07:41

i\'m managing a date that comes from an Alfresco Properties and is in the specified (Tue Jul 13 00:00:00 CEST 2010) and i need to convert it to a Java date...i\'ve looked ar

5条回答
  •  清歌不尽
    2020-11-30 08:26

    Based on your comments, I believe that your property is actually of type d:date or d:datetime. If so, the property will already be coming back from Alfresco as a java Date object. So, all you'd need to do is:

      NodeRef risposta = childAssocRef.getChildRef();
      Date dataRisposta = (Date)nodeService.getProperty(risposta, AlfrescoConstants.QN_DATA_RISPOSTA);
    

提交回复
热议问题