Subject Re: [Firebird-Java] Inserting only date-part of timestam with Jaybird and Hibernate
Author Mark Rotteveel
> Thanks Mark for your suggestions.
>
> To get the desired result I used #3:
>
> Date today = new Date();
> java.sql.Date now = new
> java.sql.Date(today.getYear(),today.getMonth(),today.getDay());
>
> Only this gave me the expected result of having only dates in my
> timestamps.
> (new java.sql.Date(System.currentTimeMillis()) resulted in having a
> time-part stangely)

Hmm, that is actually weird. But I have to admit I didn't try it and only based that suggestion on the Javadoc of java.sql.Date which claims it will set the time portion to zero (in the current timezone).
--
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl