Results 1 to 1 of 1

Thread: Incorrect date value

  1. #1
    Join Date
    Jan 2012
    Posts
    52
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Question Incorrect date value

    i used the function on my php script

    Code:
    function dateconvert($date,$func){
      if ($func == 1){ //insert conversion
        list($day, $month, $year) = explode('[/.-]', $date);
        $year=trim($year);
    	$date = "$year-$month-$day";
        return $date;
      }
      if ($func == 2){ //output conversion
        list($year, $month, $day) = explode('[-.]', $date);
        if(trim($date)!=='') $date = "$day/$month/$year";
        return $date;
      }
    }
    but at the time of execution it shows an error
    : Incorrect date value: '--17-10-1989' for column 'dob' at row 1

    the data type of dob is date default null.

    how can i recover the error. help me. please give any suggestion.
    Last edited by keyboard; 10-01-2012 at 09:57 PM. Reason: Format: [code][/code] Tags

Similar Threads

  1. AM/PM incorrect with liveclock.js
    By RocknRoll in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 09-11-2011, 05:08 AM
  2. Resolved Javascript displaying incorrect date
    By jimo in forum JavaScript
    Replies: 1
    Last Post: 07-06-2010, 12:22 PM
  3. Resolved PHP RegEx Incorrect
    By bluewalrus in forum General Paid Work Requests
    Replies: 3
    Last Post: 06-22-2010, 07:21 PM
  4. Incorrect Function message
    By dipper85 in forum PHP
    Replies: 20
    Last Post: 05-11-2010, 01:13 AM
  5. Incorrect login error IE only
    By redpanda in forum JavaScript
    Replies: 13
    Last Post: 12-11-2008, 02:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •