Deutsches Datum zu TS in WHERE

Hey All,

wie kann ich ein deutsches Datum in einen Timestamp umwandeln?
WHERE description ILIKE ‘%Test%’ AND posttime > ‘22.06.2020’::TIMESTAMP

Da gibt es doch sicherlich eine Funktion.

Viele Grüße

Ronny

now()
now()::date

Andreas

WHERE description ILIKE '%Test%' 
  AND posttime > to_date('22.06.2020', 'dd.mm.yyyy')

ähm, sorry, falsch verstanden. Ich dachte Du willst aktuelle Timestamps oder so. Die Doku hat ein extra Kapitel zu Data Type Formatting Functions: https://www.postgresql.org/docs/current/functions-formatting.html

Danke für die schnelle Hilfe.
to_date(‘22.06.2020’, ‘dd.mm.yyyy’)::TIMESTAMP

Wenn Du einen Timestamp Wert willst, dann nimm einfach to_timestamp()

to_timestamp('22.06.2020', 'dd.mm.yyyy');

Ok.

Mache ich so.

Vielen Dank