Taerlin Posted February 4, 2006 Share Posted February 4, 2006 Hi I have a script that I use to send info from my contact form.I would like to have the date function changed to the following I am in Australia and I have my server in the states so I need to have the time set 16 hrs + to what I get now to give me our local time.$name = $_POST["name"];$address = $_POST["address"];$city = $_POST["city"];$state = $_POST["state"];$postcode = $_POST["postcode"];$phone = $_POST["phone"];$arrivaldate = $_POST["arrivaldate"];$departuredate = $_POST["departuredate"];$email = $_POST["email"];$comments = $_POST["comments"];$today = date("M d, Y");$recipient = "email@mydomain.com";$subject = "subjectline goes here";$forminfo ="Name: $name\nAddress: $address\nCity: $city\nState: $state\nPostcode: $postcode\nPhone: $phone\nArrival Date: $arrivaldate\nDepature Date: $departuredate\nEmail: $email\nComments: $comments\nForm Submitted: $today\n\n";I have tried a few different strings but it stops the script posting the information that the user has typed in..Any assistance would be grealy appreciatedTerry Link to comment Share on other sites More sharing options...
rappo Posted February 5, 2006 Share Posted February 5, 2006 You can put the following code somewhere in your PHP file: date_default_timezone_set('UTC'); Change the UTC to your liking, obviously. I found that information (there's a lot more if you're interesting) here. Link to comment Share on other sites More sharing options...
Taerlin Posted February 5, 2006 Author Share Posted February 5, 2006 Hi I tried that and it didnt work....Terry Link to comment Share on other sites More sharing options...
rappo Posted February 5, 2006 Share Posted February 5, 2006 Okay, sorry about that - I've found a way... tested it out.For me, I used this: <?putenv("TZ=US/Pacific");echo date("H:i");?> Here's a list of the country codes (what you would replace US/Pacific with): http://www.theprojects.org/dev/zone.txtMake sure that line is at the top of your file if you want all of the times changed. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now