Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-11 Thread Merlin Moncure
On Mon, Jan 11, 2010 at 1:16 AM, Yan Cheng Cheok wrote: > I know I can convert SQL timestamp to unix timestamp, using the following way. > > SELECT extract(epoch FROM now()); > > Now, I have a stored procedure function, which will directly return a table > row to the caller. One of the row field

Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-11 Thread Alban Hertroys
On 11 Jan 2010, at 7:16, Yan Cheng Cheok wrote: > I know I can convert SQL timestamp to unix timestamp, using the following way. > > SELECT extract(epoch FROM now()); > > Now, I have a stored procedure function, which will directly return a table > row to the caller. One of the row field is "ti

Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-11 Thread Craig Ringer
On 11/01/2010 2:16 PM, Yan Cheng Cheok wrote: I know I can convert SQL timestamp to unix timestamp, using the following way. SELECT extract(epoch FROM now()); Now, I have a stored procedure function, which will directly return a table row to the caller. One of the row field is "timestamp" type

Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-11 Thread Yan Cheng Cheok
Not working. strftime is use to convert date and time to a string. Thanks and Regards Yan Cheng CHEOK --- On Mon, 1/11/10, Vincenzo Romano wrote: > From: Vincenzo Romano > Subject: Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq > To: "Yan Cheng Cheok"

Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-10 Thread Vincenzo Romano
man 3 strftime 2010/1/11 Yan Cheng Cheok : > I try already. Neither of them can accept string parameter, and convert them > to unit timestamp (long). > > Thanks and Regards > Yan Cheng CHEOK > > > --- On Mon, 1/11/10, Vincenzo Romano wrote: > >> From: Vincenzo Romano >> Subject: Re: Get Unix t

Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-10 Thread Yan Cheng Cheok
I try already. Neither of them can accept string parameter, and convert them to unit timestamp (long). Thanks and Regards Yan Cheng CHEOK --- On Mon, 1/11/10, Vincenzo Romano wrote: > From: Vincenzo Romano > Subject: Re: Get Unix timestamp from SQL timestamp through libpq > To: "Yan Cheng Ch

Re: [GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-10 Thread Vincenzo Romano
Give a try to: man 2 time man 3 ctime 2010/1/11 Yan Cheng Cheok : > I know I can convert SQL timestamp to unix timestamp, using the following way. > > SELECT extract(epoch FROM now()); > > Now, I have a stored procedure function, which will directly return a table > row to the caller. One of th

[GENERAL] Get Unix timestamp from SQL timestamp through libpq

2010-01-10 Thread Yan Cheng Cheok
I know I can convert SQL timestamp to unix timestamp, using the following way. SELECT extract(epoch FROM now()); Now, I have a stored procedure function, which will directly return a table row to the caller. One of the row field is "timestamp" type. In my application, I am using libpq. I wish