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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:21:34+00:00 2026-06-14T01:21:34+00:00

We have an Cron-Script, which detects – if some users got kicked out of

  • 0

We have an Cron-Script, which detects – if some users got kicked out of our application.
We can detect this, if a specific value is 1 – but in the the stream, no new entries get set.
Scripts run every hour. Mostly non are detected. But since 2012-10-31 23:59:03 every user got detected. If i run the script on my local maschine or even on the same machine as the cron runs. Everything got handled as it should.
First things first, our script:

require_once ('cron_init.php');
ini_set('date.timezone', 'Europe/Berlin');
ini_set('max_execution_time', 30);
ini_set('memory_limit', -1);
error_reporting(E_ALL);
ini_set("display_errors", 1);

Zend_Date::setOptions(array('fix_dst' => true));

    $userinfos = new Repricing_Dbservices_Userinfos();
    $users = $userinfos->getUsersForRepricing();

    $repricingstream = new Repricing_Dbservices_Repricingstream();
    $error = new Repricing_Dbservices_Error();

if($users!==false AND count($users)>0){

    $counter = 0;
    $errCounter = 0;
    $jetzt = new Zend_Date();
    $jetzt->setTimezone('Europe/Berlin');
    $jetzt = $jetzt->get(Zend_Date::TIMESTAMP);

    foreach($users as $user){
        $stream = $repricingstream->getStreamLimit($user);

        $last = new Zend_Date($stream);
        $last->setTimezone('Europe/Berlin');
        $last = $last->get(Zend_Date::TIMESTAMP);

        $diff = (($jetzt-$last)/60);

        $error->setError(1, 'DIED', $diff, $user);

        if($diff > 50 ){
            $errCounter++;
            $userinfos->setUserFree($user);
            $error->setError(1, 'DIED', 'ANSTOSSEN', $user);
        }

        $counter++;
    }
    $error->setError(1, $errCounter, 'ANSTOSSEN_ALL', 'ALL');
}

Usually $diff >= 0 AND $diff <= 4 but, we detected, that $diff is always round about 381595. If we run it out of cron $diff is, as it should.
We also detected, that $jetzt is now ( as it should ) only $last is much more later. 381595 later. But that shouldnt be. The last stream-date is fully normal. We cant understand this behaviour of. Zend_Date with cron. Bevor 2012-10-21 23:59:03 the script run 2 weeks as it should. We cant explain, how come. Can you?

  • 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-06-14T01:21:35+00:00Added an answer on June 14, 2026 at 1:21 am

    Consider this:

    $right = new Zend_Date('2012-11-01 12:12:12', Zend_Date::ISO_8601);
    var_dump( $right->getIso() );        // 2012-11-01T12:12:12+00:00
    var_dump( $right->getTimestamp() );  // 1351771932
    
    $wrong = new Zend_Date('2012-11-01 12:12:12', null, 'en_US');
    var_dump( $wrong->getIso() );        // 2012-01-11T12:12:12+00:00
    var_dump( $wrong->getTimestamp() );  // 1326283932
    

    Now the real freaky part: on my PC it’s the second behavior that is default – i.e., when no additional params are given to Zend_Date constructor.

    The point is, Zend_Date is a bit… too helpful when trying to parse datetime strings. For example, it’s taking the locale into account – but the locale both of server and client! And if the string cannot be parsed within this locale’s rules, it silently gives up – and tries to use another rule.

    That’s why 2012-10-29 was parsed as October, 29 (despite of what locale suggested, as there’s no 29th month) – but 2012-11-01 became January, 11 – and messed up your script big time. )

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

Sidebar

Related Questions

I have a cron shell script which calls a stored procedure to do some
I have a cron job to run a Ruby script, which runs fine on
I have cron job - php script which is called one time in 5
I have the following script which runs once a day on cron on heroku.
I have a shell script which is called by a cron job. I don't
I have a Perl script which will run in a cron job on linux
I have a bash script that is invoked from a cron job which has
I have a CRON job php script that I just set up not too
I have a cron entry that runs a script at a certain time each
I have a python script that runs on a cron job. The script uses

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.