Hello,
Look the following code:
Java class
Code:
public class Carga
{
private long id;
private Date dtFaturamento;
...
...
get's
set's
}
Hibernate mappingCode:
<hibernate-mapping>
<class name="com.Carga">
<id name="id" type="long">
<generator class="native"/>
</id>
<property name="dtFaturamento" type="date"/>
</hibernate-mapping>
Struts - Web Tier (Jsp)Code:
<bean:write name="carga" property="dtFaturamento" format="dd/MM/yy HH:mm"/>
Result 21/06/04 00:00
Using SQLPLUS (Oracle 9.2)Code:
SELECT TO_CHAR(DTFATURAMENTO,'DD/MM/YY HH:MI') FROM CARGAS;
Result TO_CHAR(DTFATURAMENTO)
--------------
21/06/04 04:56
How can I get Date/Time format using Hibernate?
Is it possible to define what format I need to get in <property> TAG
Something like this
Code:
<property name="dtFaturamento" type="date" format="dd/mm/yy hh:mm"/>