All fields

“Date & Time Handling” in Information Technology

13 questions across 3 technologies.

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
11How would you validate that all required environment variables are present and correctly typed at application startup, rather than discovering a missing one at runtime? Node.js › Environment Variables & ConfigurationNode.jsEnvironment Variables & ConfigurationIntermediate
12What are named capture groups in a regular expression, and how do they improve the readability of extracted match data compared to using only numbered groups? PHP › Regular Expressions in PHPPHPRegular Expressions in PHPIntermediate
13How does the sprintf function let you build formatted strings with precise control over things like decimal places, padding, and alignment? PHP › Strings & String FunctionsPHPStrings & String FunctionsIntermediate