You need to sign in to do that
Don't have an account?

Change the format of a date in Visualforce
I am rendering a URL within a Viscualforce HTML Email template but the dates are in European Date/Time how do I sent them to the URL in mm/dd/yyyy format.
This is the code I have
<a href="http://xxxxl.naxxxxrvar.com/xxx/tracking/{!relatedTo.Freight_Carrier__c}?tracking_numbers={!relatedTo.Tracking_Number__c}
&order_number={!relatedTo.Name}&service={!relatedTo.Service__c}&ozip=91406&dzip={!relatedTo.ChargentSFA__Shipping_Zip__c}
&order_date={!relatedTo.CloseDate}&ship_date={!relatedTo.Dispatch_Date__c}"
style="background-color:#a41d57;border:1px solid #dbdbdb;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;mso-hide:all; align; margin: 10px;">Track My Package</a>
This is the code I have
<a href="http://xxxxl.naxxxxrvar.com/xxx/tracking/{!relatedTo.Freight_Carrier__c}?tracking_numbers={!relatedTo.Tracking_Number__c}
&order_number={!relatedTo.Name}&service={!relatedTo.Service__c}&ozip=91406&dzip={!relatedTo.ChargentSFA__Shipping_Zip__c}
&order_date={!relatedTo.CloseDate}&ship_date={!relatedTo.Dispatch_Date__c}"
style="background-color:#a41d57;border:1px solid #dbdbdb;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;mso-hide:all; align; margin: 10px;">Track My Package</a>
Try to format the date like this
{!day(relatedTo.CloseDate)}/{!month(relatedTo.CloseDate)}/{!year(relatedTo.CloseDate)}
You will also need to do this for the dispatch date
Hope this helps!
AM