Jump to content

Recommended Posts

Hello,

 

I don't know if this is the place to post this and if not i'm sorry. I am creating a podcast admin which will let users import data into a database then create xml based off of that. I currently have a list of drop down that allow the user to select the weekday, day, time etc then when that is done it outputs it into a database cell in the complete rfc 2822 format (Wed, 6 Jul 2005 13:00:00 PDT) Everything is working fine except i want the user to be able to modify the podcast later which means i need to be able to pull the data back out and into the selection boxes. I'm not sure if i should explode the date or what. The other option would be have multiple tables for date but that seams messy and unnecessary. Any help  on this would be great.

 

Thanks!

Brandon

Link to comment
https://forums.phpfreaks.com/topic/117420-solved-explode-rfc-2822-date/
Share on other sites

Hi,

 

I've found one small problem with pulling the time this way. It will pull the time fine but will try to put it in either the severs current time zone or whatever timezone i specify. Is there a way to have it pull the time but keep it in the timezone it was originally set in?

 

Thanks,

Brandon

I've found one small problem with pulling the time this way. It will pull the time fine but will try to put it in either the severs current time zone or whatever timezone i specify. Is there a way to have it pull the time but keep it in the timezone it was originally set in?

 

Actually, if you're seeing the same thing I am, the date/time that is interpreted from the strtotime() call is accurate, but the date() function does output in the server time, but that time is relative to the date and time entered. So, for instance, my server is in EST: the time input was 1:00pm, and the time output by my server is 4:00pm on the date provided. So, the reading of your time is accurate, but you would need to be sure to output it in the timezone appropriate to the user (in this case, yourself).

 

For that solution, if you are running PHP5.1+, you can check out date_default_timezone_set().

Obsidian,

 

thanks again for your help. I understand that this is not an issue with the time being incorrect. However for my application I'm allowing the user to choose what timezone they want the data to be stored in. This works fine until i go to pull the data back out using strtotime(). I apologize if date_default_timezone_set gave the answer to this I'm still fairly new to php and after reviewing the manual i couldn't see how this function could help other than set the timezone (currently being done with putenv().

 

Thanks,

Brandon

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.