By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,661 Members | 1,330 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,661 IT Pros & Developers. It's quick & easy.

Timestamp to date conversion...plz help me

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
> 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.