Home > Article > Backend Development > Analysis of examples of using mktime in php to obtain timestamps
Display the results: now is 2012/05/30 Obviously this is not the result I want. So, according to the old thinking, it was naturally transformed into the following form:
Pay attention to the red part, usually if the month Use m, then the minute should be M. Or use M for the former and m for the latter. Show results: Warning: mktime() expects parameter 2 to be long, string given in D:usrwebroottestPHPindex.php on line 46 now is 1970/01/01 08:Jan:00 The correct answer is this:
haha~ It's "i" instead of What is m or M? I am giving you this example just to save beginners of PHP from taking some detours. As for what M means, smart person, you will definitely understand. Show results: now is 2012/05/30 04:54:25 >>>> Articles you may be interested in: Detailed explanation of the differences between time(), date(), and mktime() in php Analysis of the difference between time() and mktime() usage in php Y2K38 vulnerability of strtotime() and mktime() in php 2038 issue |