What did you try so far? Oracle <> PostgreSQL, check the manual
– Frank Heikens
I tried everything. The question is simple. Date with meridian indicator in timestamp without time zone datatype. There was no need to do a -1 on my question.
– alpha_calling
The query makes no sense to begin with. You are converting sysdate to a formatted varchar just to convert that varchar back to a date which sysdate was to begin with.
– a_horse_with_no_name
3 Answers
13
votes
Instead of sysdate you should use current_timestamp, or now():
Try the below function to accept time stamp with AM/PM over PostgreSQL
TO_CHAR(SYSDATE, 'MM/DD/YYYY HH12:MI:SS AM')
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
varchar
just to convert that varchar back to adate
whichsysdate
was to begin with. – a_horse_with_no_name