TEXT   65

CTime

Guest on 29th May 2022 02:40:23 AM

  1. NAME
  2.     Time::CTime -- format times ala POSIX asctime
  3.  
  4. SYNOPSIS
  5.             use Time::CTime
  6.             print ctime(time);
  7.             print asctime(localtime(time));
  8.             print strftime(template, localtime(time));
  9.  
  10.   strftime conversions
  11.             %%      PERCENT
  12.             %a      day of the week abbr
  13.             %A      day of the week
  14.             %b      month abbr
  15.             %B      month
  16.             %c      ctime format: Sat Nov 19 21:05:57 1994
  17.             %d      DD
  18.             %D      MM/DD/YY
  19.             %e      numeric day of the month
  20.             %f      floating point seconds (milliseconds): .314
  21.             %F      floating point seconds (microseconds): .314159
  22.             %h      month abbr
  23.             %H      hour, 24 hour clock, leading 0's)
  24.             %I      hour, 12 hour clock, leading 0's)
  25.             %j      day of the year
  26.             %k      hour
  27.             %l      hour, 12 hour clock
  28.             %m      month number, starting with 1, leading 0's
  29.             %M      minute, leading 0's
  30.             %n      NEWLINE
  31.             %o      ornate day of month -- "1st", "2nd", "25th", etc.
  32.             %p      AM or PM
  33.             %r      time format: 09:05:57 PM
  34.             %R      time format: 21:05
  35.             %S      seconds, leading 0's
  36.             %t      TAB
  37.             %T      time format: 21:05:57
  38.             %U      week number, Sunday as first day of week
  39.             %v      DD-Mon-Year
  40.             %w      day of the week, numerically, Sunday == 0
  41.             %W      week number, Monday as first day of week
  42.             %x      date format: 11/19/94
  43.             %X      time format: 21:05:57
  44.             %y      year (2 digits)
  45.             %Y      year (4 digits)
  46.             %Z      timezone in ascii. eg: PST
  47.  
  48. DESCRIPTION
  49.     This module provides routines to format dates. They correspond to the
  50.     libc routines. &strftime() supports a pretty good set of coversions --
  51.     more than most C libraries.
  52.  
  53.     strftime supports a pretty good set of conversions.
  54.  
  55.     The POSIX module has very similar functionality. You should consider
  56.     using it instead if you do not have allergic reactions to system
  57.     libraries

Raw Paste


Login or Register to edit or fork this paste. It's free.