Re: how to convert JAVA string in "hh:mm dd/mm/yyyy" to sql datetime format?
- From: David Harper <devnull@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 20 Mar 2007 19:14:45 GMT
shivaraj wrote:
On Mar 19, 4:53 pm, Arne Vajhøj <a...@xxxxxxxxxx> wrote:[SNIP]
Ian,
by mistakly I said it as ""hh:mm dd/mm/yyyy" but it is ""hh:mm
mm/dd/yyyy" format. I will try splitting that string into date and
time and try to use it as sql date format.
Arne,
To try with this approach, I am not getting any patterns in
"hh:mm mm/dd/yyyy" in SimpleDateFormat to convert it into java date
format. If that is the case again I have to split it as Ian said. Is
that so or am i missing something?
You should read the Javadoc for java.text.SimpleDateFormat more carefully.
Lowercase 'm' denotes minutes in an hour, whereas uppercase 'M' denotes months in a year. You cannot assume that you can use 'm' for both month and minute.
You also need to beware of the distinction between 'h' and 'H' for the hour. Both are valid, but they will yield different results.
Attention to detail is vital.
David Harper
Cambridge, England
.
- References:
- Prev by Date: JDBC - Oracle - Procedure/Fonction
- Next by Date: Re: JDBC - Oracle - Procedure/Fonction
- Previous by thread: Re: how to convert JAVA string in "hh:mm dd/mm/yyyy" to sql datetime format?
- Next by thread: JDBC - Oracle - Procedure/Fonction
- Index(es):
Relevant Pages
|
|