Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Date conversion error
Date conversion error [message #2572] Wed, 30 June 2010 01:30 Go to next message
MadJik is currently offline  MadJik
Messages: 4
Registered: June 2010
Junior Member
Hi,

I've choosen the date format "DD/MM/YY" in config.inc:
$GLOBALS['date_format'] = 'dd/mm/yy'; // '21/06/01'

I've created a new user and I've tried to update it when I've got the message:
This application has encountered an unrecoverable error

The following has been reported to the administrator:
2010-06-30 07:23:31

Fatal Error: Uncaught exception fron Exception, message = DateTime::__construct() [datetime.--construct]: Failed to parse time string (30/06/10 07:23:11) at position 0 (3): Unexpected character (# 256).

Error in line 377 of file 'C:\xampp\htdocs\radicore\includes\error.inc'.

PHP_SELF: /radicore/menu/mnu_user(upd1).php

SERVER_ADDR: 127.0.0.1

SERVER_NAME: localhost

HTTP_HOST: localhost

User Id: MGR

REMOTE_ADDR: 127.0.0.1

REQUEST_URI: /radicore/menu/mnu_user(upd1).php?session_name=menu0

It seems the 3 of 30/06/10 is unexpected...
For now I will use another date format.

Thanks.


/MadJik
Re: Date conversion error [message #2574 is a reply to message #2572] Wed, 30 June 2010 06:37 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2363
Registered: April 2006
Location: Surrey, UK
Senior Member
DateTime::__construct() is only ever called when the user's timezone is different from the server timezone.

After setting $GLOBALS['date_format'] to 'dd/mm/yy' and creating a new user on 30-06-2010 I played around with various updates to see what happened. I could never get it to abort, but I did get some invalid dates. See if the update in the attached file fixes your problem.

What version of PHP are you using? What timezones?


Re: Date conversion error [message #2575 is a reply to message #2574] Wed, 30 June 2010 07:54 Go to previous messageGo to next message
MadJik is currently offline  MadJik
Messages: 4
Registered: June 2010
Junior Member
PHP/5.3.1
Gmt + 1 (Paris)


/MadJik
Re: Date conversion error [message #2576 is a reply to message #2575] Wed, 30 June 2010 08:38 Go to previous message
AJM is currently offline  AJM
Messages: 2363
Registered: April 2006
Location: Surrey, UK
Senior Member
This function requires two different timezones, and you have only identified one. So what TWO timezones are you using?

Previous Topic: MySQL: Updating SET data type fields
Next Topic: Update from a Detail Screen works incorrectly
Goto Forum:
  


Current Time: Thu Oct 31 19:55:20 EDT 2024

Total time taken to generate the page: 0.03241 seconds