Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Date and Time PHP Code?

Posted on 2013-06-01
2
Medium Priority
?
402 Views
Last Modified: 2013-06-19
I've go this:

<?php date_default_timezone_set('UTC'); echo date('l, F d, Y'); ?>

but it's showing up day forward.

How can I get current USA, New York timezone?
0
Comment
Question by:sandshakimi
2 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 39213771
<?php date_default_timezone_set('America/New_York'); echo date('l, F d, Y'); ?>

http://us2.php.net/manual/en/timezones.america.php
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question