13 questions for “Date & Time Handling”

Found in 1 field. Select a question to see its full answer.

Information Technology

13 questions in 3 technologies

#QuestionTechnologyTopicLevel
1What is the DateTime class in PHP, and why is it generally preferred over using the older date function alone? PHP › Date & Time HandlingPHPDate & Time HandlingBeginner
2How do you format a date or time value in PHP using the format method, and what do common format characters like Y, m, and d represent? PHP › Date & Time HandlingPHPDate & Time HandlingBeginner
3How do you add or subtract a specific amount of time from a date using PHP's DateInterval and the modify or add methods? PHP › Date & Time HandlingPHPDate & Time HandlingIntermediate
4How does PHP's DateTime class handle time zones, and why is explicitly setting a time zone important for applications serving users in different regions? PHP › Date & Time HandlingPHPDate & Time HandlingIntermediate
5What is the difference between DateTime and DateTimeImmutable, and why might a codebase deliberately prefer the immutable version despite the extra verbosity? PHP › Date & Time HandlingPHPDate & Time HandlingAdvanced
6How should an application handle daylight saving time transitions correctly when performing date arithmetic across such a transition? PHP › Date & Time HandlingPHPDate & Time HandlingAdvanced
7How do you calculate the difference between two dates in PHP, and what information does the DateInterval object returned by the diff method provide? PHP › Date & Time HandlingPHPDate & Time HandlingIntermediate
8Why is manually working with time zones using the Date object error-prone? JavaScript › Date, Time & Internationalization (Intl API)JavaScriptDate, Time & Internationalization (Intl API)Advanced
9Why is Date.parse() considered unreliable for parsing date strings? JavaScript › Date, Time & Internationalization (Intl API)JavaScriptDate, Time & Internationalization (Intl API)Beginner
10Why does new Date(2026, 7, 8) represent August 8th, not July 8th? JavaScript › Date, Time & Internationalization (Intl API)JavaScriptDate, Time & Internationalization (Intl API)Advanced