472,145 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Timestamp to date conversion...plz help me

Hi,
I want to extract date part (mm/dd/yy or any other date format) of Timestamp in postgreSQL. Can anyone help me out how I can proceed?.

Regards,
Ch.V.J. Kumar

|Associate Consultant | iGATE Global Solutions Limited | Office: 5521701 xtn 3031 | 9886219429| Ji*************@igate.com



Nov 12 '05 #1
2 30518
On Sat, Oct 18, 2003 at 10:21:03PM +0530, Jitender Kumar C wrote:
Hi,
I want to extract date part (mm/dd/yy or any other date format) of
Timestamp in postgreSQL. Can anyone help me out how I can
proceed?.


SELECT your-timestamp-value::date

or, more standard,
SELECT CAST(your-timestamp-value AS date)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"When the proper man does nothing (wu-wei),
his thought is felt ten thousand miles." (Lao Tse)

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #2
> I want to extract date part (mm/dd/yy or any other date format) of Time=
stamp in postgreSQL. Can anyone help me out how I can proceed?.


You have at least two choices:

select current_timestamp::date;

will give you the date in the default date format.

select to_char(current_timestamp,'mm/dd/yy');

gives you control over the formatting.
--
Mike Nolan
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ben | last post: by
3 posts views Thread by praba kar | last post: by
1 post views Thread by Dave | last post: by
reply views Thread by Casey | last post: by
6 posts views Thread by Scott Nixon | last post: by
7 posts views Thread by JJ | last post: by
5 posts views Thread by kyosohma | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.