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 431829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:00:49+00:00 2026-05-12T20:00:49+00:00

Frankly, I’m flummoxed. Can anyone tell me why I would get a failure message

  • 0

Frankly, I’m flummoxed. Can anyone tell me why I would get a failure message with this code?

$date = Zend_Date::now();
$date = $date->getIso();

if(Zend_Date::isDate($date, Zend_Date::ISO_8601)) {
    print('success');
} else {
    print('failure');
}

exit;

It also fails if I just pass in a Zend_Date object.

UPDATE:

a var_dump of the initial $date object looks like this:

object(Zend_Date)#107 (8) { [“_locale:private”]=> string(5) “en_US” [“_fractional:private”]=> int(0) [“_precision:private”]=> int(3) [“_unixTimestamp:private”]=> int(1257508100) [“_timezone:private”]=> string(14) “America/Denver” [“_offset:private”]=> int(25200) [“_syncronised:private”]=> int(0) [“_dst:protected”]=> bool(true) }

And a var_dump of the $date string after calling $date->getIso() looks like this:

string(25) “2009-11-06T04:48:20-07:00”

I am using ZF 1.9.5 on PHP 5.2.8. I am using XAMPP for Windows too if that makes a difference.

  • 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-12T20:00:49+00:00Added an answer on May 12, 2026 at 8:00 pm

    I’m running ZF 1.9.4 and PHP 5.2.10 on Ubuntu and was able to reproduce the exact same problem you had. Being the curious type, I did a little digging. Within the code for isDate, a call was made first to getDate within the companion class Zend_Locale_Format. This is wrapped around a try-catch loop, so within the catch portion, I had it dump the exception to stdout. Here’s what the exception dump showed me:

    exception 'Zend_Locale_Exception' with message 'Unable to parse date 
    '2009-11-06T04:26:46-08:00' using 'dd mm yy' (d  y)' in /usr/share/php/libzend-framework-php/Zend/Locale/Format.php:995
    Stack trace:
    #0 /usr/share/php/libzend-framework-php/Zend/Locale/Format.php(1116): Zend_Locale_Format::_parseDate('2009-11-06T04:2...', Array)
    #1 /usr/share/php/libzend-framework-php/Zend/Date.php(4583): Zend_Locale_Format::getDate('2009-11-06T04:2...', Array)
    #2 {censored}/testbed/test.php(26): Zend_Date::isDate('2009-11-06T04:2...', 'c')
    #3 {main}
    

    Doing a var_dump on this exception was a little more telling about those opaque Arrays. Each of them contained the following:

     array(4) {                                                                       
              ["locale"]=>                                                                   
              string(5) "en_US"                                                              
              ["date_format"]=>                                                              
              string(8) "dd mm yy"                                                           
              ["format_type"]=>                                                              
              string(3) "iso"                                                                
              ["fix_date"]=>                                                                 
              bool(false)                                                                    
            }           
    

    So, date_format doesn’t look right at all. It should be “YYYYMMDD’T’hh:mm:ssP,” or something like that, in PHP date formatting lingo (I quoted the T, since it’s the literal ‘T’ and not a timezone abbreviation). Granted, PHP just abbreviates it as ‘c’.

    Strange. So where in the world is it getting this date format? From _getLocalizedToken:

     protected static function _getLocalizedToken($token, $locale)
        {
            switch($token) {
                case self::ISO_8601 :
                    return "dd mm yy";
                    break;
    ...
    

    That format looks completely wrong, given the output that ISO_8601 produces.

    I would probably check with the people on the appropriate Zend list, but at first glance, this looks like something worthy of a bug report. Maybe they just don’t support checks this particular type of date string yet?

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

Sidebar

Related Questions

Frankly I am not sure where this would go but I assume the way
This is a homework question. Frankly, I'm not sure how a C program delivers
I've never understood this, and frankly, it pisses me off to see it in
I have a script and I'm almost done but I get this error and
This is a pretty stale question but frankly I'm yet to find it answered
This is my first question here on StackOverflow, and quite frankly I'm fairly new
I mean accessing it from .NET code, not javascript. Is this just a negative
My problem is, frankly, that I'm unsure how this works. I need to modify
Technically this is my first try in nodejs and frankly I am not sure
I'm working with some old code (and frankly I don't know half of what

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.