format character explain Return value example
Japan --- ---
d The day of the month , With leading zeros 2 Digit number 01 To 31
j The day of the month , No leading zeros 1 To 31
S The English suffix after the number of days of each month ,2 Characters st,nd,rd perhaps th. You can talk to j Together with
z The day of the year 0 To 366
week --- ---
l(“L” Lowercase letters of ) What day , Full text format Sunday To Saturday
D Day of the week , The text means ,3 Letters Mon To Sun
N ISO-8601 The day of the week represented by the format number (PHP 5.1.0 New addition ) 1( For Monday ) To 7( Sunday )
w Day of the week , Digital representation 0( Sunday ) To 6( For Saturday )
W ISO-8601 The week in the format year , Every week starts on Monday (PHP 4.1.0 Newly added ) for example :42( The first day of that year 42 Zhou )
month --- ---
F month , Full text format , for example January perhaps March January To December
m The number of months , There are leading zeros 01 To 12
M Three letter abbreviations for the month Jan To Dec
n The number of months , No leading zeros 1 To 12
t The number of days a given month should have 28 To 31
year --- ---
L Leap year or not If it's a leap year, it's 1, Otherwise 0
o ISO-8601 Format year number . This sum Y The value of is the same , Except if ISO Number of weeks (W) Belong to the previous year or the next year , That year .(PHP 5.1.0 New addition ) Examples: 1999 or 2003
Y 4 The year represented in full by digits for example :1999 or 2003
y 2 The year in digits for example :99 or 03
Time --- ---
a Lower case morning and afternoon values am or pm
A Morning and afternoon in capitals AM or PM
B Swatch Internet Standard time 000 To 999
g Hours ,12 Hour format , No leading zeros 1 To 12
G Hours ,24 Hour format , No leading zeros 0 To 23
h Hours ,12 Hour format , There are leading zeros 01 To 12
H Hours ,24 Hour format , There are leading zeros 00 To 23
i Minutes with leading zeros 00 To 59>
s Number of seconds , There are leading zeros 00 To 59>
The time zone --- ---
e Time zone identification (PHP 5.1.0 New addition ) for example :UTC,GMT,Atlantic/Azores
I Is it daylight saving time If it's summer time, it's 1, Otherwise 0
O The number of hours from Greenwich mean time for example :+0200
P And Greenwich mean time (GMT) The difference between , There is a colon between hours and minutes (PHP 5.1.3 New addition ) for example :+02:00
T The time zone of this machine for example :EST,MDT(【 translator's note 】 stay Windows Next is the full text format , for example “Eastern Standard Time”, The Chinese version will show “ China standard time ”).
Z The number of seconds of the TDOA offset .UTC The time zone offset to the west is always negative ,UTC The time zone offset to the East is always positive . -43200 To 43200
The full date / Time --- ---
c ISO 8601 Format date (PHP 5 New addition ) 2004-02-12T15:19:21+00:00
r RFC 822 Format date for example :Thu, 21 Dec 2000 16:01:07 +0200
U from Unix An era (January 1 1970 00:00:00 GMT) The number of seconds since the beginning Timestamp See  time()

PHP More articles on the time format controller comparison table

  1. linux After acquisition time -- Customize the time format

    Customize the time format =================================-===================================== #include <stdio.h ...

  2. NSDateFormatter Time format conversion

    NSString *strDate = @“Wed Apr ::”; NSDateFormatter *dateFomatter =[[NSDateFormatter alloc] init]; [d ...

  3. Time format conversion — Will be back in the background /Date(1448954018000)/ Format to normal time format

    use JS Implementation method : function ChangeDateFormat(cellval) { )); < ? ) : date.getMonth() + ; ? " + date.get ...

  4. Newtonsoft.Json Serialization and deserialization Time format 【 turn 】

    1.JSON serialize string JsonStr= JsonConvert.SerializeObject(Entity); eg:   A a=new A(); a.Name="Elain ...

  5. Spring mvc Time format processing

    spring mvc in , If the time format is yyyy-MM-dd, An error will be reported when it is passed into the background , You need to add some configuration . 1. modify spring-mvc.xml, increase ...

  6. db2 Date time format

    db2 Date and time are often summarized 1.db2 Can pass SYSIBM.SYSDUMMY1.SYSIBM.DUAL Get the value in the register , It can also be done through VALUES Keyword to get the value in the register . SELECT 'HELLO DB2 ...

  7. JavaScriptSerializer serialize json Time format

    utilize JavaScriptSerializer serialize json Time format , Got DateTime The value is displayed as “/Date(700000+0500)/” Formal JSON character string , Obviously there's a transformation to be made 1. Use the string straight ...

  8. sqlserver Time format function details

    One . Time function Using stored procedures ,sql Function , There will be some processing of time . For example, time acquisition and addition and subtraction . It's here sql The time function comes with . Now I'll list these functions , Convenient for future memory , Use . --getdate Get the current time ...

  9. espcms Member secondary development document description —— members , Time format

    [espcms Member picture field ] Add fields, add picture types /webadm/include/inc_formtypelist.php Members modify the page model /webadm/templates/member/membe ...

Random recommendation

  1. 【BZOJ 1455】 Rome games

    Left leaning tree template #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ...

  2. java Background generation zip Package files

    /** * * @param zipFile Compressed package file object * @param listKey Compressed picture physical address * @return */ public static boolean package ...

  3. 【 Add big numbers 】POJ-1503、NYOJ-103

    1503:Integer Inquiry Total time limit :  1000ms Memory limit :  65536kB describe One of the first users of BIT's new supercompu ...

  4. easyui Source translation 1.32--ComboTree( Tree dropdown )

    Preface Extend from $.fn.combo.defaults and $.fn.tree.defaults. Use $.fn.combotree.defaults Override the default object . Download the plug-in translation source code The tree drop-down box combines selection control and ...

  5. Java Concurrent —— Thread safety 、 Thread synchronization 、 Thread communication

    Thread safety Interprocess " share " object Multiple “ Write ” Threads access objects at the same time . example :Timer Example of num member , namely add() The method is to use the number of times . namely Timer Instances are resource objects . class TestSync ...

  6. Hibernate Different databases dialect | drive |url To configure

    Hibernate Different database dialects | drive |url mySql: hibernate.dialect : org.hibernate.dialect.MySQLDialect driverClassNam ...

  7. java Adapter pattern of design pattern exploration

    1. summary Convert the interface of one class to another that the customer wants .Adapter Patterns allow classes that could not work together because of incompatible interfaces to work together . 2. Problem solved namely Adapter Mode makes the original interface incompatible ...

  8. 1572: [Usaco2009 Open] Work arrangement Job[ greedy ]

    Description Farmer John There's so much work to do !!!!!!!! To make the farm run efficiently , He has to make money from his work , Each job takes one unit of time . His workday starts from 0 The moment begins , Yes 1000000000 A list ...

  9. Hackers often use windows Register book

    Catalog So that the system doesn't have " function " Options                         1 Let the operating system have no " Shutdown system " Options                     2 Let the operating system ...

  10. React-Native And redux And react-redux

    Preface this paper There are supporting videos , You can watch it as you like . The content of the article varies from person to person , There may be deviations , Welcome to contact me to discuss . All the contents in this article are for learning and communication only , Not for commercial use , Such as the related laws and regulations liability caused by this , It's none of my business , As in the text ...