Home > Demos > fbDateTime Class (Improved strftime())   DateTime.php   DateTime.php   Locale.php   Debug.php   ISO639.php   StrUtils.php   ISO3166.php  

strftime()

Supported

 %a: 'Sun'                                   : abbreviated weekday name according to the current locale
 %A: 'Sunday'                                : full weekday name according to the current locale
 %b: 'May'                                   : abbreviated month name according to the current locale
 %B: 'May'                                   : full month name according to the current locale
 %c: 'Sun May  6 01:03:04 2007'              : preferred date and time representation for the current locale
 %C: '20'                                    : century number (the year divided by 100 and truncated to an integer, range 00 to 99)
 %d: '06'                                    : day of the month as a decimal number (range 01 to 31)
 %D: '05/06/07'                              : same as %m/%d/%y
 %e: ' 6'                                    : day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31')
 %g: '07'                                    : like %G, but without the century.
 %G: '2007'                                  : The 4-digit year corresponding to the ISO week number (see %V). This has the same format and value as %Y, except that if the ISO week number belongs to the previous or next year, that year is used instead.
 %h: 'May'                                   : same as %b
 %H: '01'                                    : hour as a decimal number using a 24-hour clock (range 00 to 23)
 %I: '01'                                    : hour as a decimal number using a 12-hour clock (range 01 to 12)
 %j: '126'                                   : day of the year as a decimal number (range 001 to 366)
 %m: '05'                                    : month as a decimal number (range 01 to 12)
 %M: '03'                                    : minute as a decimal number
 %n: '
'                                     : newline character
 %p: 'AM'                                    : either `am' or `pm' according to the given time value, or the corresponding strings for the current locale
 %r: '01:03:04 AM'                           : time in a.m. and p.m. notation
 %R: '01:03'                                 : time in 24 hour notation
 %S: '04'                                    : second as a decimal number
 %t: '	'                                     : tab character
 %T: '01:03:04'                              : current time, equal to %H:%M:%S
 %u: '7'                                     : weekday as a decimal number [1,7], with 1 representing Monday
 %U: '18'                                    : week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week
 %V: '18'                                    : The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. (Use %G or %g for the year component that corresponds to the week number for the specified timestamp.)
 %W: '18'                                    : week number of the current year as a decimal number, starting with the first Monday as the first day of the first week
 %w: '0'                                     : day of the week as a decimal, Sunday being 0
 %x: '05/06/07'                              : preferred date representation for the current locale without the time
 %X: '01:03:04'                              : preferred time representation for the current locale without the date
 %y: '07'                                    : year as a decimal number without a century (range 00 to 99)
 %Y: '2007'                                  : year as a decimal number including the century
 %Z: 'UTC'                                   : time zone or name or abbreviation
 %%: '%'                                     : a literal `%' character

Supported (Windows Specific)

%#c: 'Sun May  6 01:03:04 2007'              : Long date and time for the current locale
%#x: '05/06/07'                              : Long date for the current locale
%#d: '06'                                    : Same as %d with leading zeros removed (if any)
%#H: '01'                                    : Same as %H with leading zeros removed (if any)
%#I: '01'                                    : Same as %I with leading zeros removed (if any)
%#j: '126'                                   : Same as %j with leading zeros removed (if any)
%#M: '03'                                    : Same as %M with leading zeros removed (if any)
%#S: '04'                                    : Same as %S with leading zeros removed (if any)
%#U: '18'                                    : Same as %U with leading zeros removed (if any)
%#w: '0'                                     : Same as %w with leading zeros removed (if any)
%#W: '18'                                    : Same as %W with leading zeros removed (if any)
%#y: '07'                                    : Same as %y with leading zeros removed (if any)
%#Y: '2007'                                  : Same as %Y with leading zeros removed (if any)

Unsupported


date()

Supported

  a: am                                      : Lowercase Ante meridiem and Post meridiem am or pm
  A: AM                                      : Uppercase Ante meridiem and Post meridiem AM or PM
  B: 085                                     : Swatch Internet time 000 through 999
  c: 2007-05-06T01:03:04+00:00               : ISO 8601 date (added in PHP 5)
  d: 06                                      : Day of the month, 2 digits with leading zeros 01 to 31
  D: Sun                                     : A textual representation of a day, three letters Mon through Sun
  F: May                                     : A full textual representation of a month, such as January or March January through December
  g: 1                                       : 12-hour format of an hour without leading zeros 1 through 12
  G: 1                                       : 24-hour format of an hour without leading zeros 0 through 23
  h: 01                                      : 12-hour format of an hour with leading zeros 01 through 12
  H: 01                                      : 24-hour format of an hour with leading zeros 00 through 23
  i: 03                                      : Minutes with leading zeros 00 to 59
  I: 0                                       : (capital i) Whether or not the date is in daylights savings time 1 if Daylight Savings Time, 0 otherwise.
  j: 6                                       : Day of the month without leading zeros 1 to 31
  l: Sunday                                  : (lowercase 'L') A full textual representation of the day of the week Sunday through Saturday
  L: 0                                       : Whether it's a leap year 1 if it is a leap year, 0 otherwise.
  m: 05                                      : Numeric representation of a month, with leading zeros 01 through 12
  M: May                                     : A short textual representation of a month, three letters Jan through Dec
  n: 5                                       : Numeric representation of a month, without leading zeros 1 through 12
  O: +0000                                   : Difference to Greenwich time (GMT) in hours Example: +0200
  r: Sun, 06 May 2007 01:03:04 +0000         : RFC 822 formatted date Example: Thu, 21 Dec 2000 16:01:07 +0200
  s: 04                                      : Seconds, with leading zeros 00 through 59
  S: th                                      : English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j
  t: 31                                      : Number of days in the given month 28 through 31
  T: UTC                                     : Timezone setting of this machine Examples: EST, MDT ...
  U: 1178413384                              : Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) See also time()
  w: 0                                       : Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
  W: 18                                      : ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0) Example: 42 (the 42nd week in the year)
  Y: 2007                                    : A full numeric representation of a year, 4 digits Examples: 1999 or 2003
  y: 07                                      : A two digit representation of a year Examples: 99 or 03
  z: 125                                     : The day of the year 0 through 366
  Z: 0                                       : Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. -43200 through 43200

Unsupported


fbLocale::strftime()

Supported

 %a: 'Sun'                                   : abbreviated weekday name according to the current locale
 %A: 'Sunday'                                : full weekday name according to the current locale
 %b: 'May'                                   : abbreviated month name according to the current locale
 %B: 'May'                                   : full month name according to the current locale
 %c: 'Sun May  6 01:03:04 2007'              : preferred date and time representation for the current locale
 %C: '20'                                    : century number (the year divided by 100 and truncated to an integer, range 00 to 99)
 %d: '06'                                    : day of the month as a decimal number (range 01 to 31)
 %D: '05/06/07'                              : same as %m/%d/%y
 %e: ' 6'                                    : day of the month as a decimal number, a single digit is preceded by a space (range ' 1' to '31')
 %g: '07'                                    : like %G, but without the century.
 %G: '2007'                                  : The 4-digit year corresponding to the ISO week number (see %V). This has the same format and value as %Y, except that if the ISO week number belongs to the previous or next year, that year is used instead.
 %h: 'May'                                   : same as %b
 %H: '01'                                    : hour as a decimal number using a 24-hour clock (range 00 to 23)
 %I: '01'                                    : hour as a decimal number using a 12-hour clock (range 01 to 12)
 %j: '126'                                   : day of the year as a decimal number (range 001 to 366)
 %m: '05'                                    : month as a decimal number (range 01 to 12)
 %M: '03'                                    : minute as a decimal number
 %n: '
'                                     : newline character
 %p: 'AM'                                    : either `am' or `pm' according to the given time value, or the corresponding strings for the current locale
 %r: '01:03:04 AM'                           : time in a.m. and p.m. notation
 %R: '01:03'                                 : time in 24 hour notation
 %S: '04'                                    : second as a decimal number
 %t: '	'                                     : tab character
 %T: '01:03:04'                              : current time, equal to %H:%M:%S
 %u: '7'                                     : weekday as a decimal number [1,7], with 1 representing Monday
 %U: '18'                                    : week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week
 %V: '18'                                    : The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. (Use %G or %g for the year component that corresponds to the week number for the specified timestamp.)
 %W: '18'                                    : week number of the current year as a decimal number, starting with the first Monday as the first day of the first week
 %w: '0'                                     : day of the week as a decimal, Sunday being 0
 %x: '05/06/07'                              : preferred date representation for the current locale without the time
 %X: '01:03:04'                              : preferred time representation for the current locale without the date
 %y: '07'                                    : year as a decimal number without a century (range 00 to 99)
 %Y: '2007'                                  : year as a decimal number including the century
 %Z: 'UTC'                                   : time zone or name or abbreviation
 %%: '%'                                     : a literal `%' character

Unsupported

$CVSHeader: _freebeer/www/demo/DateTime.php,v 1.2 2004/03/07 17:51:33 ross Exp $