List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 5 1999 6:23pm
Subject:Re: Current Date
View as plain text  
At 2:13 PM -0400 7/5/1999, toxalot@stripped wrote:
>Does MySQL have a function to get the current date?

Yes, it's called CURRENT_DATE. :-)  NOW() gives you current date and time.

>I want to find the current date and compare it to the users subscription
>expiry date to detemine if he still has access.
>I am working in perl DBI and I could get the date from the server using
>localtime or something, but it would be nice to just say
>SELECT * FROM tbl_name WHERE expiry_date > current_date
>Without having to properly format localtime first.

Is the server in a different timezone than the client?

>If you could give me proper syntax in perl DBI, it would be greatly

It has nothing to do with DBI syntax; you're using DBI to send SQL
statements that have the same format as they would have were you using
the mysql client (except that you don't add semicolons to your statements).

Paul DuBois, paul@stripped
Northern League Chronicles:
Current Datetoxalot5 Jul
  • Re: Current DateMartin Ramsch5 Jul
  • Re: Current DatePaul DuBois5 Jul
  • ORDER BY numericallyAaron Johnson5 Jul
    • Re: ORDER BY numericallyPaul DuBois6 Jul
    • value changed on insertPeter J. Schoenster6 Jul
      • Re: value changed on insertPat Sherrill6 Jul
      • Re: value changed on insertPaul DuBois6 Jul