+ Start a Discussion
steph1sourcesteph1source 

Dates and Users Local Settings

I have an scontrol that is taking the value from a date field (Sub Start Date) and putting that value into another date field (Sub Start Date2). I then have a calculated field that compares the values in these two fields so that I can determine whether the user has changed the value in Sub Start Date since hitting the link for the scontrol. The problem I am having is with the date format. I have a user in the UK who tested the scontrol and after he hit the link the value in the Sub Start Date2 is stored as 11/4/2007 on the database. The value in Sub Start Date is 4/11/2007 and so my calculated field incorrectly declares them as different. How do I get the scontrol to store the date in Sub Start Date2 as m-d-yyyy like Sub Start Date instead of using the user's locale? This is the code that I have right now:
 

var substartdate = new Date("{!SFDC_520_Quote__c.Subscription_Start_Date__c}");

upd.set("Subscription_Start_Date2__c",substartdate);

 

thanks

Stephanie