Given a Date value, return the full name of the day of the week as a string (for example, 'Monday', 'Tuesday', 'Wednesday', etc.). Return null for null input.

Examples:

Input: d = Date.newInstance(2026, 5, 27) Output: 'Wednesday' Explanation: May 27, 2026 falls on a Wednesday Input: d = Date.newInstance(2026, 1, 1) Output: 'Thursday' Explanation: January 1, 2026 falls on a Thursday Input: d = Date.newInstance(2026, 6, 1) Output: 'Monday' Explanation: June 1, 2026 falls on a Monday Input: d = Date.newInstance(2026, 12, 25) Output: 'Friday' Explanation: December 25, 2026 falls on a Friday Input: d = null Output: null Explanation: Null input returns null
Apex Code Editor

Welcome to Lightning Challenge!

How It Works

  • • Write your solution in the code editor
  • • Connect your Salesforce org to test
  • • Submit to check if your solution passes
  • • Use hints if you get stuck

Contest Alert

🏆 #CodeEveryDay September 2026 (Sep 1–15)Sponsored by FLXBL

Contest runs September 1 - 15. Complete challenges to climb the leaderboard!

1st & 2nd: Salesforce certification exam voucher see all prizes

Only the 15 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In