[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Problems with Weborb php 3.5 datetime

Posted on 2009-02-09
2
Medium Priority
?
808 Views
Last Modified: 2012-05-06
Hi, I'm using weborb php 3.5 & WDMF (automatic generated coding) and when adding a record with a datetime field in a MySQL database, I realized that all datetime fields are zeroes (both date and time parts) but thanks to "Charles" I saw that the information is ok. The problem is when I use findAll method y received all fields ok except datetime fields.....all zeroes. The problem seems to be in "weborb/Util/ORBDateTime.php" file..any suggestion????.
I used a possible solution but nothing. Can't convert or cast Dates.
class ORBDateTime
{
    private $m_milliseconds;
    private $m_stringDateTime;
    private $m_timeZone;
 
    public function __construct($dateTimeMs, $timeZone)
    {
        if (is_string($dateTimeMs)){
                $dateTimeMs = strtotime($dateTimeMs) * 1000;
        }
        $this->m_milliseconds = $dateTimeMs;
        $this->m_timeZone = $timeZone;
        if ($dateTimeMs == null)
                $this->m_stringDateTime = null;
        else
                $this->m_stringDateTime = date("Y-n-j h:i:s A", round($dateTimeMs/1000));      
    }
 
/*  -->>>Original code of constructor
    public function __construct($dateTimeMs, $timeZone)
    {
        $this->m_milliseconds = $dateTimeMs;
        $this->m_timeZone = $timeZone;
        if ($dateTimeMs == null)
        	$this->m_stringDateTime = null;
        else
        	$this->m_stringDateTime = date("n/j/Y h:i:s A", round($dateTimeMs/1000));
        
    }
 
*/

Open in new window

0
Comment
Question by:cpach115
2 Comments
 
LVL 19

Accepted Solution

by:
Jones911 earned 1500 total points
ID: 23596915
Try this.

$this->m_stringDateTime = date('Y-m-d H:i:s', $dateTimeMs);
0
 

Expert Comment

by:avrenna
ID: 25650497
FYI, this refers to:
Weborb\Util\ORBDateTime.php
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses
Course of the Month17 days, 22 hours left to enroll

830 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