Cep Posted October 3, 2006 Share Posted October 3, 2006 Hello, I am pulling a date field from an Access database and displaying it within a text box on my form.The format the information is currently in is, 2005-11-07 00:00:00.I need to display this date as 07/11/2005 (D M Y)I have looked at the strftime function and it doesnt appear to work, I just keep getting a different combination of 01/01/1970.How can I change this so that it displays correctly? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 3, 2006 Share Posted October 3, 2006 Use a combination of strtotime() and date():[code]<?php$date_str = '2005-11-07 00:00:00';echo date('d/m/Y',strtotime($date_str));?>[/code]Ken Quote Link to comment Share on other sites More sharing options...
Cep Posted October 3, 2006 Author Share Posted October 3, 2006 Aha! I was using the wrong format function then, needed strtotime. Thanks Ken! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.