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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:24:25+00:00 2026-05-27T18:24:25+00:00

I have the following problem. I have a script that gets the Airdate of

  • 0

I have the following problem. I have a script that gets the Airdate of TV Shows and i alter it before I save it to my database. Locally on my localhost it works perfect, but when I tried it online and uploaded it to my web server it shows a different behavior. I have no idea why it is so.

Here are some examples:


The Data I get: Aired 1/22/12

What the outcome of my script should be: 2012-01-22

What I get online: 2022/12–


The Data I get: Aired 8/29/11

What the outcome of my script should be: 2011-08-29

What I get online: 2029/11–


The Data I get: Airs 2/12/12

What the outcome of my script should be: 2012-02-12

What I get online: 2012/12–


Here is my PHP script:

if(strstr($serie['airdate'], 'Airs')) {
            $date = substr($serie['airdate'], 5);
        }

        if(strstr($serie['airdate'], 'Aired')) {
            $date = substr($serie['airdate'], 6);
        }

        $mm = strstr($date, "/", true);
        $mmStrLen = strlen($mm);
        if((strlen($mm)) == "1") {
            $mm = "0".$mm;
        }

        $dd = substr($date, $mmStrLen+1);
        $dd = strstr($dd, "/", true);
        $ddStrLen = strlen($dd);
        if((strlen($dd)) == "1") {
            $dd = "0".$dd;
        }

        $yy = substr($date, $mmStrLen+1+$ddStrLen+1);
        if((strlen($yy)) == "1") {
            $yy = "0".$yy;
        }

        $serie['date'] = "20".$yy."-".$mm."-".$dd;

$serie[‘airdate’] is the data I get and $serie[‘date’] is where the altered value should be saved.

The PHP Version I use locally is 5.3.8 and the one of my webhoster is 5.2.17. But I guess this is not the root of the problem.

  • 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-27T18:24:25+00:00Added an answer on May 27, 2026 at 6:24 pm

    Can’t format a comment as code, so I must write it as an answer.

    Please try this on both sides

    $x=explode(' ',$serie['airdate']);
    if (sizeof($x)!=2) die("Error in step 1");
    $x=explode('/',$x[1]);
    if (sizeof($x)!=3) die("Error in step 2");
    $serie['date']=sprintf("20%02d-%02d-%02d",$x[2],$x[0],$x[1]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code, the only problem is that when the code gets
I have the following problem: <script type=text/javascript> alert(1. ČĆŽŠĐčćžšđ); </script> <script type=text/javascript src=Tst.js></script> <script
I have a problem with following script. It generates a list of places which
it is the problem, i can't undertand anyway. i have the following simple script
I have an interesting problem. I wrote the following perl script to recursively loop
I have a quite simple perl script, that in one function does the following:
I have the following script that will update the connection string across three different
i am new to Action Script and i have the following problem: i have
I have the following html code: (that gets loaded via ajax into a div)
I have the following script that parses some | delimited field/value pairs. Sample data

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.