Lautarox Posted July 2, 2008 Share Posted July 2, 2008 How can i input a variable in the date function? i want to do something like this $arrtime['date'] //equals to d/m/Y or whatever and $arr['fecha'] to a saved time () $date = date("$arrtime['date']",$arr['fecha']); And, what about somthing like this the last $arrtime['date'], plus $arrtime['time'] var that contains G:i:s $date = date("$arrtime['date'] '$arrtime['time']'",$arr['fecha']); Any help? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/112961-solved-help-php-date/ Share on other sites More sharing options...
lemmin Posted July 2, 2008 Share Posted July 2, 2008 The strtotime() function will convert a date string into a unix timestamp that you can use to create a date object. Here is the documentation for it: http://www.php.net/manual/en/function.strtotime.php Click the "Date Input Formats" for more info on the format. Quote Link to comment https://forums.phpfreaks.com/topic/112961-solved-help-php-date/#findComment-580341 Share on other sites More sharing options...
Lautarox Posted July 2, 2008 Author Share Posted July 2, 2008 What i want is to made a cfg that stores how the date will be shown Quote Link to comment https://forums.phpfreaks.com/topic/112961-solved-help-php-date/#findComment-580479 Share on other sites More sharing options...
Lautarox Posted July 3, 2008 Author Share Posted July 3, 2008 dont lose the thread Quote Link to comment https://forums.phpfreaks.com/topic/112961-solved-help-php-date/#findComment-581010 Share on other sites More sharing options...
libertyct Posted July 3, 2008 Share Posted July 3, 2008 you can create a date in the following format mktime($hour,$minute, $second,$month,$day,$year); is this what you meant? Quote Link to comment https://forums.phpfreaks.com/topic/112961-solved-help-php-date/#findComment-581013 Share on other sites More sharing options...
Lautarox Posted July 3, 2008 Author Share Posted July 3, 2008 Not really, i was triying to make a pre-configurated way of showing the date from a time() function, I want to modify the date format with vars to make it easier Quote Link to comment https://forums.phpfreaks.com/topic/112961-solved-help-php-date/#findComment-581033 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.