Forum OpenACS Q&A: Date as non-obvious numbers

Collapse
Posted by Bob OConnor on

I need a fixed non obvious number that I could get from a PG date. Instead of the obvious date time: 20011024160045, I would like a raw number from a date ... something like seconds since 1970 or similar... It would be reproducable but not known to the casual observer that it is a date. My brief search through the postgresql docs come up with nothing....

Thanks -Bob

Collapse
Posted by Don Baccus on
Try this:
select date_part('epoch', current_timestamp);