- Print (Date ("L DS of F Y h:i:s A"));
- Print ("July 1, is on a". Date ("L", Mktime (0,0,0,7,1,2000)));
- ?>
Copy CodeExample two:
- $tomorrow = Mktime (0,0,0,date ("M"), Date ("D") +1,date ("Y"));
- $lastmonth = Mktime (0,0,0,date ("M") -1,date ("D"), Date ("Y"));
- $nextyear = Mktime (0,0,0,date ("M"), Date ("D", Date ("Y") +1);
- ?>
Copy CodeReference gmdate () mktime () Strftime the time of the server to be formatted locally. Syntax: string strftime (string format, int [timestamp]); return value: String function type: Time date content Description The string of the return value is determined by the configured format. If there is an incoming timestamp value, the timestamp is formatted and returned if no time stamp value is passed, and the current server's time is formatted locally. The month or week name varies with the local language configuration setlocale (). The returned string can be in the following format:
- SetLocale ("Lc_time", "C");
- Print (Strftime ("%A in Finnish is");
- SetLocale ("Lc_time", "fi");
- Print (Strftime ("%A, in French"));
- SetLocale ("Lc_time", "fr");
- Print (Strftime ("%A and in German"));
- SetLocale ("Lc_time", "de");
- Print (Strftime ("%A.N"));
- ?>
Copy CodeReference setlocale () mktime () GetDate Get time and date information. Syntax: array getdate (int timestamp); return value: function type: Time date content Description The element that returns an array includes the following items: "Seconds"-second "minutes"-minute "hours"-when "mday"-the Day of the month "wday"-the day of the week when the number "Mon"-The month number "year"-the number of days of the day number "Yday"-the current year; such as: "299" "weekday"-the full name of the week; such as: "Friday" "Month"-the full name of the month; such as: "January"Gettimeofday get the current time. Syntax: array gettimeofday (void); return value: function type: Time date content Description The element that returns an array includes the following items: "SEC"-seconds "usec"-one out of 10,000 seconds "minuteswest"-GMT "Dsttime"-the purpose of the time zoneThe gmdate obtains the current time with the GMT difference. Syntax: string gmdate (string format, int timestamp); return value: String function type: Time Date content Description This function is similar to the date () function, the difference is that this function is returned with Greenwich Mean Time (Greenwich Mean Time, GMT) 1 2 Next last page |