You need to sign in to do that
Don't have an account?
bryano
Date bug in AJAX Beta2 Toolkit?
I think there might be a bug in the AJAX beta 2 toolkit. I'm on Eastern Standard Time and I'm trying to set a GMT time into a date/time field in salesforce. The date being saved in salesforce always seems to be 1 day off when I enter any time between 7:00 PM EST - 11:00 PM EST/
I have a s-control with a text field that has the following value: 3/15/2006 7:00 PM
Here's my code: (logMessage() is a function that displays debugging message on my screen)
var date = new Date(form.textField.value);
logMessages("date is " + date); displays Wed Mar 15 2006 19:00:00 GMT-0500 (Eastern Standard Time)
logMessages("setting UTCYear to " + date.getUTCFullYear()); displays 2006
logMessages("setting UTCMonth to " + date.getUTCMonth()); displays 2
logMessages("setting UTCDate to " + date.getUTCDate()); displays 16
logMessages("setting UTCHours to " + date.getUTCHours()); displays 0
logMessages("setting UTCMinutes to " + date.getUTCMinutes); displays 0
logMessages("setting UTCSeconds to " + date.getUTCSeconds()); displays 0
date.setUTCFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
date.setUTCHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
Then I set the field with something like: field.set("myCustomField__c", date);
When I pull the date back in to the scontrol, I get 3/14/2006 7:00 PM
Now when I extract the value being saved with the data loader this is what I get:
2006-03-15T00:00:00.000Z (notice it's setting gmt date to the 15th and not the 16th).
This happens with any time between 7 pm - 11 pm EST. If I enter 12:00 AM, I get the correct date and time.
Is there a fix for this?
I have a s-control with a text field that has the following value: 3/15/2006 7:00 PM
Here's my code: (logMessage() is a function that displays debugging message on my screen)
var date = new Date(form.textField.value);
logMessages("date is " + date); displays Wed Mar 15 2006 19:00:00 GMT-0500 (Eastern Standard Time)
logMessages("setting UTCYear to " + date.getUTCFullYear()); displays 2006
logMessages("setting UTCMonth to " + date.getUTCMonth()); displays 2
logMessages("setting UTCDate to " + date.getUTCDate()); displays 16
logMessages("setting UTCHours to " + date.getUTCHours()); displays 0
logMessages("setting UTCMinutes to " + date.getUTCMinutes); displays 0
logMessages("setting UTCSeconds to " + date.getUTCSeconds()); displays 0
date.setUTCFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
date.setUTCHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
Then I set the field with something like: field.set("myCustomField__c", date);
When I pull the date back in to the scontrol, I get 3/14/2006 7:00 PM
Now when I extract the value being saved with the data loader this is what I get:
2006-03-15T00:00:00.000Z (notice it's setting gmt date to the 15th and not the 16th).
This happens with any time between 7 pm - 11 pm EST. If I enter 12:00 AM, I get the correct date and time.
Is there a fix for this?
Hope this helps.
Luisd