You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by ilyak <il...@mail.ru> on 2008/09/03 10:28:07 UTC

How to view TIMESTAMP in yyyy-mm-dd hh:mm:ss format

Hello all, please help me!

My application connects to the Derby DB.
 jdbc:derby://***.***.***.***:1527/MY_DB;
And uses org.apache.derby.jdbc.ClientDriver

I use a table with TIMESTAMP fields 
and insert values in it using ij in '2008-08-16 01:24:31' (ISO)  format.

But my application selects data from this table in '08/06/08 11:36 AM MSD'
format.
Please tell me how to say Derby server to return timestamp columns in ISO
format.
Because haven't possibility to change source code of this application.:( 
And is it possible to disable such localization?

Thanks,

Ilya




-- 
View this message in context: http://www.nabble.com/How-to-view-TIMESTAMP-in-yyyy-mm-dd-hh%3Amm%3Ass-format-tp19285007p19285007.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: How to view TIMESTAMP in yyyy-mm-dd hh:mm:ss format

Posted by ilyak <il...@mail.ru>.
Thanks for your answer Mikael Aronsson.
Now I have changed this columns to varchar (30) and now it is works.





  


ilyak wrote:
> 
> Hello all, please help me!
> 
> My application connects to the Derby DB.
>  jdbc:derby://***.***.***.***:1527/MY_DB;
> And uses org.apache.derby.jdbc.ClientDriver
> 
> I use a table with TIMESTAMP fields 
> and insert values in it using ij in '2008-08-16 01:24:31' (ISO)  format.
> 
> But my application selects data from this table in '08/06/08 11:36 AM MSD'
> format.
> Please tell me how to say Derby server to return timestamp columns in ISO
> format.
> Because haven't possibility to change source code of this application.:( 
> And is it possible to disable such localization?
> 
> Thanks,
> 
> Ilya
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-view-TIMESTAMP-in-yyyy-mm-dd-hh%3Amm%3Ass-format-tp19285007p19287456.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Re: How to view TIMESTAMP in yyyy-mm-dd hh:mm:ss format

Posted by Mikael <mi...@telia.com>.
What do you mean with "Derby server to return timestamp columns in ISO 
format." ?

A timestamp is a long value, it is not formatted in any way, formatting is
done by the client application, not Derby, for example, the toString() 
method
in Timestamp formats the time in ISO 8601 format, but many applications 
format
dates and times using the current Locale.

When you say "But my application selects data from this table in
'08/06/08 11:36 AM MSD' format." do you mean that your application
ask SQL queries using that format ?

If that is the case then you will have to look into your application and 
check
if it is possible to change that format in any way, maybe changing the 
locale.

----- Original Message ----- 
From: "ilyak" <il...@mail.ru>
To: <de...@db.apache.org>
Sent: Wednesday, September 03, 2008 10:28 AM
Subject: How to view TIMESTAMP in yyyy-mm-dd hh:mm:ss format


>
> Hello all, please help me!
>
> My application connects to the Derby DB.
> jdbc:derby://***.***.***.***:1527/MY_DB;
> And uses org.apache.derby.jdbc.ClientDriver
>
> I use a table with TIMESTAMP fields
> and insert values in it using ij in '2008-08-16 01:24:31' (ISO)  format.
>
> But my application selects data from this table in '08/06/08 11:36 AM MSD'
> format.
> Please tell me how to say Derby server to return timestamp columns in ISO
> format.
> Because haven't possibility to change source code of this application.:(
> And is it possible to disable such localization?
>
> Thanks,
>
> Ilya
>
>
>
>
> -- 
> View this message in context: 
> http://www.nabble.com/How-to-view-TIMESTAMP-in-yyyy-mm-dd-hh%3Amm%3Ass-format-tp19285007p19285007.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>