INeedAGig Posted October 31, 2011 Share Posted October 31, 2011 Okay, I have this form system/processor I have programmed and I am having a minor issue. When the form data is sent via email I want the date/time the user submitted the information included in the email, mainly for records. Now, I thought using $_SERVER['REQUEST_TIME'] would work, but it is returning a value of "1320019222" in the email, any tips on how to fix this?? Thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/250134-help-with-datetime-fetch/ Share on other sites More sharing options...
xtopolis Posted October 31, 2011 Share Posted October 31, 2011 It is working correctly. You want to take that integer value and format it to your specs probably using the date function Quote Link to comment https://forums.phpfreaks.com/topic/250134-help-with-datetime-fetch/#findComment-1283547 Share on other sites More sharing options...
INeedAGig Posted October 31, 2011 Author Share Posted October 31, 2011 Oh okay, so I missed a step I guess. Thanks for your reply! Quote Link to comment https://forums.phpfreaks.com/topic/250134-help-with-datetime-fetch/#findComment-1283552 Share on other sites More sharing options...
INeedAGig Posted October 31, 2011 Author Share Posted October 31, 2011 Sorry, me again. I don't think I am formatting the info in the correct spot, here is a code example, which is returning a server error. $time = $_SERVER['REQUEST_TIME'] date("F j, Y, g:i a"); Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/250134-help-with-datetime-fetch/#findComment-1283554 Share on other sites More sharing options...
INeedAGig Posted October 31, 2011 Author Share Posted October 31, 2011 Any tips? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/250134-help-with-datetime-fetch/#findComment-1283563 Share on other sites More sharing options...
xtopolis Posted October 31, 2011 Share Posted October 31, 2011 date(String $format, [int $timestamp]); so probably something like: $time = date("F j, Y, g:i a", $_SERVER['REQUEST_TIME']); Though I think most people just do date("format", now()); where format is how you have it above. Test it out and see which gives you what you want. Quote Link to comment https://forums.phpfreaks.com/topic/250134-help-with-datetime-fetch/#findComment-1283572 Share on other sites More sharing options...
INeedAGig Posted October 31, 2011 Author Share Posted October 31, 2011 date(String $format, [int $timestamp]); so probably something like: $time = date("F j, Y, g:i a", $_SERVER['REQUEST_TIME']); Though I think most people just do date("format", now()); where format is how you have it above. Test it out and see which gives you what you want. This is the exact result I was going for, just had my code a little jumbled. Thanks for your help Xtopolis! Quote Link to comment https://forums.phpfreaks.com/topic/250134-help-with-datetime-fetch/#findComment-1283573 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.