logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Apache 2.2.22 & PHP 5.3.8 - Date/Time format problems
Author
HelderS



Joined: 11 Sep 2012
Posts: 2
Location: Portugal

PostPosted: Tue 11 Sep '12 15:20    Post subject: Apache 2.2.22 & PHP 5.3.8 - Date/Time format problems Reply with quote

Hello, everyone,

I'm experiencing some problems after I installed Apache 2.2.23 and PHP 5.3.8 on a Windows Server 2008 R2.

I've both Apache and PHP working. But when I started to use my web application that uses Dates, which were working ok on a different computer, but accessing same database computer( portuguese date/time definitions).

The problem is: I've defined in "Region and Language" settings of Windows to Portuguese format( day-month-yyyyear Hour:Minute:Seconds ), and when I retrieve a Date/Time variable from a SQL Database it returns in a format that appears to be American ( month/day/yyyyear Hour:Minutes:Seconds AM/PM )

Is it possible to define the portuguese format anywhere in Apache?

I've already changed the setting for timezone in php.ini, but It seems to remain the same.

Hope someone could help me.

Thanks in advance.

Best regards,

Hélder Silva
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 11 Sep '12 15:30    Post subject: Reply with quote

You can sue pure PHP to do so.

Code:

$datetime = strtotime($row->createdate);
$mysqldate = date("d-m-Y H:i:s", $datetime);
Back to top
HelderS



Joined: 11 Sep 2012
Posts: 2
Location: Portugal

PostPosted: Tue 11 Sep '12 15:41    Post subject: Reply with quote

Yes, but like I said, it was actually working before this new setup, and I'm avoiding change the PHP code.

Thanks anyway, but not the solution I was looking for.

Hélder
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 17 Sep '12 17:25    Post subject: Reply with quote

You can set it on MySQL as well

See
http://dev.mysql.com/doc/refman/5.5/en/locale-support.html

See also http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html
SELECT DATE_FORMAT('2007-10-04 22:23:00', '%H:%i:%s');
Back to top


Reply to topic   Topic: Apache 2.2.22 & PHP 5.3.8 - Date/Time format problems View previous topic :: View next topic
Post new topic   Forum Index -> Other Software