Author Topic: [SOLVED] please help in this error...  (Read 518 times)

0 Members and 1 Guest are viewing this topic.

Offline watthehellTopic starter

  • Enthusiast
  • Posts: 143
    • View Profile
[SOLVED] please help in this error...
« on: September 05, 2007, 02:36:40 AM »
Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in c:\wamp\www\visionary\eventsearch1.php on line 413

In line 413 i have
 
Code: [Select]
switch ( date("w", strtotime("$yr-01-01 12:00:00")) ) { //this is line 413
        case 6:
            $bankHols[] = "$yr-01-03";
            break;
        case 0:
            $bankHols[] = "$yr-01-02";
            break;
        default:
            $bankHols[] = "$yr-01-01";
    }

thnks in advance
EVERY TIME YOU ARE POSTING AN ANSWER, YOU ARE LEARNING SOMETHING NEW ;)
----------------------------------------------
Do not worry about your problems with PHP, I assure you mine are far greater.
----------------------------------------------
Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.
-------------------------------------- onLy gOd can jUdGe me !!!!!

Offline darkfreaks

  • Fanatic
  • Posts: 4,306
  • Gender: Male
    • View Profile
    • Site Security
Re: please help in this error...
« Reply #1 on: September 05, 2007, 02:54:20 AM »
Try

Code: [Select]
<?php
switch ( date("w"), (strtotime("$yr-01-01 12:00:00")))  { //this is line 413
?>

Offline watthehellTopic starter

  • Enthusiast
  • Posts: 143
    • View Profile
Re: please help in this error...
« Reply #2 on: September 05, 2007, 02:59:04 AM »
I copied ur code and now it gives this error

Parse error: syntax error, unexpected ',' in c:\wamp\www\visionary\eventsearch1.php on line 413

Code: [Select]
<?php
switch ( date("w"),(strtotime("$yr-01-01 12:00:00"))) { // line 413
        
case 6:
            
$bankHols[] = "$yr-01-03";
            break;
        case 
0:
            
$bankHols[] = "$yr-01-02";
            break;
        default:
            
$bankHols[] = "$yr-01-01";
    }
?>


« Last Edit: September 05, 2007, 03:00:16 AM by watthehell »
EVERY TIME YOU ARE POSTING AN ANSWER, YOU ARE LEARNING SOMETHING NEW ;)
----------------------------------------------
Do not worry about your problems with PHP, I assure you mine are far greater.
----------------------------------------------
Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.
-------------------------------------- onLy gOd can jUdGe me !!!!!

Offline darkfreaks

  • Fanatic
  • Posts: 4,306
  • Gender: Male
    • View Profile
    • Site Security
Re: please help in this error...
« Reply #3 on: September 05, 2007, 03:02:55 AM »
Code: [Select]
<?php

switch ( date("w")(strtotime("$yr-01-01 12:00:00"))) { // line 413 ?>

Offline watthehellTopic starter

  • Enthusiast
  • Posts: 143
    • View Profile
Re: please help in this error...
« Reply #4 on: September 05, 2007, 03:06:29 AM »
now this error on same line

Parse error: syntax error, unexpected '(' in c:\wamp\www\visionary\eventsearch1.php on line 413
EVERY TIME YOU ARE POSTING AN ANSWER, YOU ARE LEARNING SOMETHING NEW ;)
----------------------------------------------
Do not worry about your problems with PHP, I assure you mine are far greater.
----------------------------------------------
Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.
-------------------------------------- onLy gOd can jUdGe me !!!!!

Offline darkfreaks

  • Fanatic
  • Posts: 4,306
  • Gender: Male
    • View Profile
    • Site Security
Re: please help in this error...
« Reply #5 on: September 05, 2007, 03:10:09 AM »
i changed it back original syntax but used getdate function :
Code: [Select]

<?php

switch ( getdate("w"strtotime("$yr-01-01 12:00:00")) ) { //this is line 413

?>


Offline watthehellTopic starter

  • Enthusiast
  • Posts: 143
    • View Profile
Re: please help in this error...
« Reply #6 on: September 05, 2007, 03:12:15 AM »
thnks for your replies but again i get an error

Warning: Wrong parameter count for getdate() in c:\wamp\www\visionary\eventsearch1.php on line 413
EVERY TIME YOU ARE POSTING AN ANSWER, YOU ARE LEARNING SOMETHING NEW ;)
----------------------------------------------
Do not worry about your problems with PHP, I assure you mine are far greater.
----------------------------------------------
Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.
-------------------------------------- onLy gOd can jUdGe me !!!!!

Offline darkfreaks

  • Fanatic
  • Posts: 4,306
  • Gender: Male
    • View Profile
    • Site Security
Re: please help in this error...
« Reply #7 on: September 05, 2007, 03:17:01 AM »
not sure if this is a PHP function but try

adodb_getdate() or read up on it looks like what u need.

Offline watthehellTopic starter

  • Enthusiast
  • Posts: 143
    • View Profile
Re: please help in this error...
« Reply #8 on: September 05, 2007, 03:21:32 AM »
anyway thanks.. i will check it..
EVERY TIME YOU ARE POSTING AN ANSWER, YOU ARE LEARNING SOMETHING NEW ;)
----------------------------------------------
Do not worry about your problems with PHP, I assure you mine are far greater.
----------------------------------------------
Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.
-------------------------------------- onLy gOd can jUdGe me !!!!!

Offline darkfreaks

  • Fanatic
  • Posts: 4,306
  • Gender: Male
    • View Profile
    • Site Security
Re: please help in this error...
« Reply #9 on: September 05, 2007, 03:22:58 AM »
http://phplens.com/phpeverywhere/adodb_date_library


appearantly your sposed to install it somehow and it defines the date in your script and replaces the date functions with adobd_date which is pretty cool because it will solve ur problem

Offline watthehellTopic starter

  • Enthusiast
  • Posts: 143
    • View Profile
Re: please help in this error...
« Reply #10 on: September 05, 2007, 05:22:38 AM »
thnks a lot it is workin now  :D :)
EVERY TIME YOU ARE POSTING AN ANSWER, YOU ARE LEARNING SOMETHING NEW ;)
----------------------------------------------
Do not worry about your problems with PHP, I assure you mine are far greater.
----------------------------------------------
Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.
-------------------------------------- onLy gOd can jUdGe me !!!!!

Offline jesirose

  • Fanatic
  • Posts: 3,819
  • Gender: Female
  • PHP Goddess
    • View Profile
    • Reed's Training Blog
Re: [SOLVED] please help in this error...
« Reply #11 on: September 05, 2007, 05:28:22 AM »
Oh for pete's sake.
It looks like $yr is too low. IE, 0. Did you ever try printing it out right before that line to make sure it was set?
Every time you post "It didn't work" without more explanation, God kills a kitten.
When you post code without code tags, He just teases a puppy. But it's still sad.
What does that php function do? | What does that term mean? | I don't see any errors! | Awesome API Interface
PHP Goddess with Attitude since 2004