Jump to content

a date function need


bluetoother

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...