Lars282 Posted June 25, 2012 Share Posted June 25, 2012 Hey! How do I set the date field when adding pages through the API? It defaults to today's date when using the admin, and I want to achieve the same when uploading through the API. Thanks, Lars Link to comment Share on other sites More sharing options...
ryan Posted June 25, 2012 Share Posted June 25, 2012 You can do it like this to set it to today's date/time: $page->date = time(); Or like this to set a specific date/time, you can use any format that PHP's strtotime() function accepts, like this: $page->date = "2012-06-25 11:36:00"; 1 Link to comment Share on other sites More sharing options...
Lars282 Posted June 25, 2012 Author Share Posted June 25, 2012 Great, thanks. 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