Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1115837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:12:52+00:00 2026-05-17T03:12:52+00:00

More problems with dates. Basically I’m trying to populate a table with some datetime

  • 0

More problems with dates.

Basically I’m trying to populate a table with some datetime values from Zend. The datatype of the column that I’m trying to populate is ‘datetime’. However, no matter which constant I try the column is always populated with zeroes. I’ve tried Zend_Date::ISO_8601, Zend_Date::DATETIME, Zend_Date::now() to no avail. Pleas help.

Here’s the code:

           if(!$exists){
                $date_time = Zend_Date::DATETIME;
                /*
                 * Create the new site record
                 */
                $site_row = $site_table->createRow();
                //if(isset($n_r['id']))    $row->id  = $n_r['id'];
                $site_row->name         = $n_r['name'];
                $site_row->active       = 1;

                $site_id = $site_table->total() + 1;
                $address_id = $address_table->total() + 1;

                $site_row->id       = $site_id;
                $site_row->address_id       = $address_id;

                /*
                 * Create the address record to go with it
                 */
                $address_row = $address_table->createRow();
                $address_row->postcode = $n_r['postcode'];
                $address_row->address_line1 = $n_r['name'];
                $address_row->start_date = $date_time;

                $address_row->id = $address_id;
                $address_row->save();
                $array[] = $site_row->toArray();
                $site_row->save();

                /*
                 * Create the new site2address record to go with it
                 */
                $site2address_row = $site2address_table->createRow();
                $site2address_row->site_id = $site_id;
                $site2address_row->address_id = $address_id;
                $site2address_row->start_date = $date_time;
            }else{
                $array[] = $exists;
            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T03:12:52+00:00Added an answer on May 17, 2026 at 3:12 am

    mySQL expects input for DATETIME columns to be

    YYYY-MM-DD HH:MM:SS
    

    independent from the locale you are using. I can’t see a Zend constant for that, you may need to format it yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

You may notice from my last question that a problem caused some more problems,
i have a problem with selecting some values from my DB. DB is in
The problem of how to handle dates in JSON is one of the more
Buried in mySQL syntax and query structure problems once more. I'm currently doing this
I'm having problems with stored procedures, this part to me more specific : CREATE
I've tried looking around and there are similar problems, but mine is way more
I'm cross-posting this from the wordpress section, b/c I think the problem lies more
I have some problems with a PHP script that calls a Bash script.... in
I have a big fat query that's written dynamically to integrate some data. Basically
So, basically I want to make objects Songs from iTunes Library.xml The problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.