没任何区别 mm Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
mm Displays the month as a number with a leading zero (01-12). If the mm specifier hh Displays the hour with a leading zero (00-23). nn Displays the minute with a leading zero (00-59).
delphi - helpDelphi Object and Component Reference Date-Time Format Strings
没有区别,yyyy mm dd hh mm/nn ss 如果硬要说区别的话,就是为了怕表示月的mm和表示分的mm混淆而想出的缓解办法 如果你把mm或者nn换成dd的话你会发现发现小时后面跟的是当天的日期 而 showmessage(formatdatetime('yyyy-mm-dd hh:nn:ss',now)) 和 showmessage(formatdatetime('yyyy-mm-dd hh:mm:ss',now)) 显示的结果是一样的
mm Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
hh Displays the hour with a leading zero (00-23).
nn Displays the minute with a leading zero (00-59).
Date-Time Format Strings
如果硬要说区别的话,就是为了怕表示月的mm和表示分的mm混淆而想出的缓解办法
如果你把mm或者nn换成dd的话你会发现发现小时后面跟的是当天的日期
而
showmessage(formatdatetime('yyyy-mm-dd hh:nn:ss',now))
和
showmessage(formatdatetime('yyyy-mm-dd hh:mm:ss',now))
显示的结果是一样的