pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
timestamp calculations
2+ messages / 2 participants
[nested] [flat]

* timestamp calculations
@ 2001-01-25 23:14 Steve Leibel <stevel@bluetuna.com>
  2001-01-26 00:05 ` Re: timestamp calculations Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Steve Leibel @ 2001-01-25 23:14 UTC (permalink / raw)
  To: pgsql-general@postgresql.org

Hello,

I'm converting a mysql db to postgres and ran into this line of code:

   $SQL = "select username from users where user_id = ? AND session = ?
           AND ADDDATE(last_login, INTERVAL 30 MINUTE)>CURRENT_TIMESTAMP()

How do I implement adddate to get this kind of funcionality?

Thanks,

Steve Leibel



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: timestamp calculations
  2001-01-25 23:14 timestamp calculations Steve Leibel <stevel@bluetuna.com>
@ 2001-01-26 00:05 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Stephan Szabo @ 2001-01-26 00:05 UTC (permalink / raw)
  To: Steve Leibel <stevel@bluetuna.com>; +Cc: pgsql-general@postgresql.org


Assuming adddate does what seems obvious, you should just be able to add
intervals to timestamps

... last_login + '30 minutes' > now()

On Thu, 25 Jan 2001, Steve Leibel wrote:

> Hello,
> 
> I'm converting a mysql db to postgres and ran into this line of code:
> 
>    $SQL = "select username from users where user_id = ? AND session = ?
>            AND ADDDATE(last_login, INTERVAL 30 MINUTE)>CURRENT_TIMESTAMP()
> 
> How do I implement adddate to get this kind of funcionality?




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-01-26 00:05 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-25 23:14 timestamp calculations Steve Leibel <stevel@bluetuna.com>
2001-01-26 00:05 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox