Saturday, 15 March 2014

last_day in PostgreSQL -



last_day in PostgreSQL -

the oracle last_day function homecoming lastly day of month. example:

nls_date_format='yyyy-mm-dd h24:mi:ss' select last_day(sysdate) dual; last_day(sysdate) ------------------- 2014-06-30 15:45:43

oracle homecoming time value well.

i have tried below sql in postgresql homecoming lastly day of month time value "00:00:00".

select (date_trunc('month', now()) + interval '1 month -1 day')::timestamp(0); ?column? --------------------------- 2014-06-30 00:00:00 (1 row)

the sql homecoming date correctly want date , time oracle.

select ( date_trunc('month', now()) + interval '1 month -1 day' + now()::time )::timestamp(0);

postgresql

No comments:

Post a Comment