|
|
NEW INTERVIEW QUESTIONS.COM
LANGUAGES INTERVIEW QUESTIONS
PHP INTERVIEW QUESTIONS DETAILS
NewInterviewQuestions.com - Home for World's Largest Interview Questions Website.
A D V E R T I S E M E N T
Question |
If you have to work with dates in the following format: "Tuesday, February 14, 2006 @ 10:39 am", how can you convert them to another format, that is easier to use?
|
Answer
|
The strtotime function can convert a string to a timestamp. A timestamp can be converted to date format. So it is best to store the dates as timestamp in the database, and just output them in the format you like.
So let's say we have $date = "Tuesday, February 14, 2006 @ 10:39 am"; In order to convert that to a timestamp, we need to get rid of the "@" sign, and we can use the remaining string as a parameter for the strtotime function.
So we have $date = str_replace("@ ","",$date); $date = strtotime($date);
now $date is a timestamp and we can say:
echo date("d M Y",$date);
© NewInterviewQuestions.com
|
If you have the better answer, than send it to us. We will display your answer after the approval.
Rate the above answer. Help us to know about the answer.
Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.
A D V E R T I S E M E N T
|
|
|
Latest 10 Answers
|
ABAP is basic (technical) side of SAP. which helps other function of business sibe ex.financial,sales,inventory& human resource.
|
Cluster index work as a primary key and as we know in a single table only one primary key should be there....Hence only one records can take cluster index.
|
Select Employee.*, Department.* from Employee LEFT OUTER JOIN Department ON Employee.EmpId=Department.DeptId
|
Both are the connection object but SQLCLIENT using while connect with Sqlserver database and OLEDB using while connect with MS-access database and Oracle database.
|
Only 1 cluster index and 255 non cluster index.
|
Because it's used to read the data from the DB as Read-only manner, only forward direction not backward..hence its not supporting edit operation.
|
I will throw my wife because if my wife dies ican get another but mother is only one I cannot get another
|
When mistake is found by compiler is known as ERROR , when a mistake is found by tester while testing is a BUG and when mistake is found by the end user it is known as DEFECT.
|
Create customer code & transporter code, create sales order, checke the payment received then released order from Finance, delivery, billing, invoice.
|
Invoice is a request sent by vendor for the payment against services/goods with all the necessary details like - Price, Rate, Quantity, Vendor Name, Vendor Address, Unique Invoice Number (From Vendor), Terms & Conditions.
|
|