Re: Values in a date field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Assuming you're using MySQL, try MONTH().  As in:

SELECT MONTH(SomeDateField) FROM SomeTable

http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html



If this isn't a database question, but a general PHP question, try this:

// For numeric month without leading zero, use "n"
echo date("n", strtotime($subscription_begins));

http://us3.php.net/manual/en/function.date.php

-TG

= = = Original message = = =

I have a $subscription_begins variable.  It the date type.  YYYY-MM-DD

How may I find out the month value (1 to 12) of this variable?

Ron


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux