Programming Languages PHP Objective
Sep 23, 2025

What is the output of: echo (new DateTime("2025-01-01"))->format("W");

Choose the correct answer:
A) 1
B) 01
C) 52
D) 53
Detailed Explanation

Explanation: The "W" format in DateTime returns the ISO-8601 week number of the year. January 1, 2025 falls in week 01 of 2025. The format returns a zero-padded two-digit week number.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback