Phpgetdate function usage example
- $ A = getdate ();
- Printf ('% s % d, % d', $ a ['month'], $ a ['mday'], $ a ['Year']);
- ?>
2. getdate () uses the specified timestamp
- $ A = getdate (163727100 );
- Printf ('% s % d, % d', $ a ['month'], $ a ['mday'], $ a ['Year']);
- ?>
3. getdate () obtains the current date.
- Getdate () get the current date -bbs.it-home.org
-
- $ Date_array = getdate ();
- Foreach ($ date_array as $ key => $ val ){
- Print "$ key = $ val
";
- }
- ?>
-
- Print "Today's date :";
- Print $ date_array ['mon']. "/". $ date_array ['mday']. "/". $ date_array ['Year'];
- ?>
-
-
Appendix: Correspondence between the return values of the getdate () function Key Valueseconds Secondsminutes Minuteshours Hoursmday Day of the monthwday Day of the week, numeric (Sunday is 0, Saturday is 6) mon Month, numericyear Year, numeric (4 digits) yday Day of the year, numeric (e.g ., 299) weekday of the week, textual, full (e.g ., "Friday") month Month, textual, full (e.g ., "January") 0 Seconds since epoch (what time () returns) |