To create an object and set the date to JUNE 22, 2013, which one of the following statement should be executed?
A. $date = Date(“22 JUNE 2013”)
B. $date = new Date(“JUNE 22 2013”)
C. $date = DateTime(“22 JUNE 2013”)
D. $date = new DateTime(“22 JUNE 2013”)
Answer: Option D
Solution(By Examveda Team)
The dateTime() method is class constructor. You can set the date either at the time of instantiation or later by using a variety of mutators.Related Questions on Date and Timestamp
A. TRUE
B. FALSE
C. Valid
D. Invalid
The date() function returns ___ representation of the current date and/or time.
A. Integer
B. String
C. Boolean
D. Float
If the format is F then which one of the following will be returned?
A. Complete text representation of month
B. Day of month, with leading zero
C. Daylight saving time
D. Day of month, without zeros
Join The Discussion