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 Binu Andrews <an...@mahindrabt.com> on 2006/01/25 14:17:16 UTC
date conversion
hi all,
i want to know wether there is any function for converting date which is
given in millisecond format to a date in proper format.
eg:- select min(start_date) from message; ------> is returning
"138015151844".
i want to convert the result into a format like "2006-01-25 18:33:38.537".
i dont want to convert to this format using java coding.
im checking for any built in functions provided by derby.
Thanks in advance
Binu Andrews.
*********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.
This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use
********************************************************
Re: date conversion
Posted by Myrna van Lunteren <m....@gmail.com>.
Hi Binu,
I'm assuming that somehow, you generate (or you're passed) a long and insert
this into a bigint column?
There is no built-in function that converts from a bigint to a timestamp.
Cast from bigint to timestamp, which would was the only other thing I
could think of, is not supported according to the manual.
The manuals have info on what *is* available, see
http://db.apache.org/derby/manuals/index.html
I think you'll either have to bite the bullet & write - one time - a java
procedure, or you'll have to modify your application code to actually create
a timestamp value...
Myrna
On 1/25/06, Binu Andrews <an...@mahindrabt.com> wrote:
>
> *hi all,*
> **
> *i want to know wether there is any function for converting date which is
> given in millisecond format to a date in proper format.*
> **
> **
> *eg:- select min(start_date) from message; ------> is returning
> "138015151844".*
> **
> *i want to convert the result into a format like "2006-01-25 18:33:38.537
> ".*
> **
> *i dont want to convert to this format using java coding.*
> *im checking for any built in functions provided by derby.*
> **
> **
> **
> **
> **
> *Thanks in advance
> Binu Andrews.
> *
>
> *********************************************************
> Disclaimer:
> The contents of this E-mail (including the contents of the enclosure(s) or
> attachment(s) if any) are privileged and confidential material of MBT and
> should not be disclosed to, used by or copied in any manner by anyone other
> than the intended addressee(s). In case you are not the desired addressee,
> you should delete this message and/or re-direct it to the sender. The views
> expressed in this E-mail message (including the enclosure(s) or
> attachment(s) if any) are those of the individual sender, except where the
> sender expressly, and with authority, states them to be the views of MBT.
>
> This e-mail message including attachment/(s), if any, is believed to be
> free of any virus. However, it is the responsibility of the recipient to
> ensure that it is virus free and MBT is not responsible for any loss or
> damage arising in any way from its use
>
> ********************************************************
>