jakebur01 Posted August 12, 2008 Share Posted August 12, 2008 Hey, I am looking for some code. I need my users to be able to select year month day time and timezone in a form. I want it to convert into a unix timestamp so I can insert it into my database. Quote Link to comment https://forums.phpfreaks.com/topic/119275-solved-php-unix-time-stamp-generator/ Share on other sites More sharing options...
MatthewJ Posted August 12, 2008 Share Posted August 12, 2008 If I see it running around anywhere I'll let you know... Quote Link to comment https://forums.phpfreaks.com/topic/119275-solved-php-unix-time-stamp-generator/#findComment-614413 Share on other sites More sharing options...
discomatt Posted August 12, 2008 Share Posted August 12, 2008 You probably want mktime() Quote Link to comment https://forums.phpfreaks.com/topic/119275-solved-php-unix-time-stamp-generator/#findComment-614426 Share on other sites More sharing options...
kenrbnsn Posted August 12, 2008 Share Posted August 12, 2008 Or the strtotime() function. Ken Quote Link to comment https://forums.phpfreaks.com/topic/119275-solved-php-unix-time-stamp-generator/#findComment-614430 Share on other sites More sharing options...
jakebur01 Posted August 12, 2008 Author Share Posted August 12, 2008 mktime looks good. I am building the form now. I will implement the time zones as well. Quote Link to comment https://forums.phpfreaks.com/topic/119275-solved-php-unix-time-stamp-generator/#findComment-614435 Share on other sites More sharing options...
jakebur01 Posted August 12, 2008 Author Share Posted August 12, 2008 What about time zones? Is there already an option value out there that already contains all of the time zones so I won't have to rebuild the whole thing? Quote Link to comment https://forums.phpfreaks.com/topic/119275-solved-php-unix-time-stamp-generator/#findComment-614436 Share on other sites More sharing options...
jakebur01 Posted August 12, 2008 Author Share Posted August 12, 2008 My server is sitting in central time zone. Dallas, TX. How do I need to set up the time zones? Quote Link to comment https://forums.phpfreaks.com/topic/119275-solved-php-unix-time-stamp-generator/#findComment-614437 Share on other sites More sharing options...
discomatt Posted August 12, 2008 Share Posted August 12, 2008 All times mktime generates are based on the server's time.... so, any way you want? Quote Link to comment https://forums.phpfreaks.com/topic/119275-solved-php-unix-time-stamp-generator/#findComment-614440 Share on other sites More sharing options...
jakebur01 Posted August 12, 2008 Author Share Posted August 12, 2008 Could you give me an example of how I would implement eastern time into this if I am on central: echo date("M-d-Y", mktime(0, 0, 0, 12, 32, 1997)); Quote Link to comment https://forums.phpfreaks.com/topic/119275-solved-php-unix-time-stamp-generator/#findComment-614441 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.