bluetoother Posted November 27, 2006 Share Posted November 27, 2006 hello guysi wonder if there is a function that return the year after i send a date value to that function .for examble :: some-php-function("2006-04-04"); ---> 2006thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted November 27, 2006 Share Posted November 27, 2006 There's not a single function to do that. If it is a string, and you can always guarantee that it will be in the format YYYY-MM-DD, then you can just get the first 4 characters. Or else, you will need to use a combination of mktime and date. You can find the date/time reference here, look up mktime and date. You might also want to look into strtotime.http://www.php.net/manual/en/ref.datetime.php Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now