Forums Register Login

Help with Date conversion from PostgreSQL database

+Pie Number of slices to send: Send
Good morning!

I have a question regarding date conversion from Postgresql DB.
You see I am querying a date from the DB

when I view the values they are in this sample format
"1982-01-14 12:34:56.000000 +08:00:00"

I would retrieve the date column
rs.getDate(note this is in date type)
I would store them in an object with the birthday attribute (which is a Date type)

my question is how can i convert tahat into Jan, 01. 1982?

+Pie Number of slices to send: Send
 

I would store them in an object with the birthday attribute (which is a Date type)


A Date does not hold any format. You don't need to do anything.

my question is how can i convert tahat into Jan, 01. 1982?


Why ? You want to hold it as a String ? If yes, you can do it using SimpleDateFormat. Can you find out which format to use ?
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1137 times.
Similar Threads
JDBC template outer join and cast(@myValue AS date)
Date & Time
Converting to UTC time zone
convert datetime from EST to PST
24 Hour Format In HQL - 00:00:00 returned as 24:00:00 using HQL
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 10:20:25.