function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
The most common way to do this (using SFDC formulas - you may have to alter this a bit for Apex) is to use a MOD function:
CASE(MOD( TODAY() - DATE(1900, 1, 7), 7), 0, "Sunday", 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday","Error")
Hope this helps.
i don't think there's a method. here's an apex version of the SFDC code posted.
Date dueDate = System.today();Date refDate = Date.newInstance(1900, 1, 7); // Jan 7 1900 = Sun
// 0 = Sun ... 6 = SatInteger dayOfWeek = Math.mod(refDate.daysBetween(dueDate), 7);
The most common way to do this (using SFDC formulas - you may have to alter this a bit for Apex) is to use a MOD function:
CASE(MOD( TODAY() - DATE(1900, 1, 7), 7), 0, "Sunday", 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday","Error")
Hope this helps.
i don't think there's a method. here's an apex version of the SFDC code posted.
Date dueDate = System.today();
Date refDate = Date.newInstance(1900, 1, 7); // Jan 7 1900 = Sun
// 0 = Sun ... 6 = Sat
Integer dayOfWeek = Math.mod(refDate.daysBetween(dueDate), 7);
String day_of_week = a_date.format('E');
day_of_week will now be 'Sun' or 'Mon' or 'Tue' or 'Wed' or 'Thu' or 'Fri' or 'Sat'