Time::CTime(3pm)

πŸ’– Time::CTime πŸ’–

okay bestie, welcome to Time::CTime(3pm) β€” the perl manual page that formats times ala POSIX asctime, and honestly? it's giving timeless. πŸ•°οΈβœ¨


✨ NAME ✨

Time::CTime -- format times ala POSIX asctime


🌸 SYNOPSIS 🌸

look at this, it's so clean:

use Time::CTime
print ctime(time);
print asctime(localtime(time));
print strftime(template, localtime(time));

πŸ¦‹ strftime conversions πŸ¦‹

every single one, no skips, periodt:

  • %% β€” PERCENT
  • %a β€” day of the week abbr
  • %A β€” day of the week
  • %b β€” month abbr
  • %B β€” month
  • %c β€” ctime format: Sat Nov 19 21:05:57 1994
  • %d β€” DD
  • %D β€” MM/DD/YY
  • %e β€” numeric day of the month
  • %f β€” floating point seconds (milliseconds): .314
  • %F β€” floating point seconds (microseconds): .314159
  • %h β€” month abbr
  • %H β€” hour, 24 hour clock, leading 0's)
  • %I β€” hour, 12 hour clock, leading 0's)
  • %j β€” day of the year
  • %k β€” hour
  • %l β€” hour, 12 hour clock
  • %m β€” month number, starting with 1, leading 0's
  • %M β€” minute, leading 0's
  • %n β€” NEWLINE
  • %o β€” ornate day of month -- "1st", "2nd", "25th", etc.
  • %p β€” AM or PM
  • %r β€” time format: 09:05:57 PM
  • %R β€” time format: 21:05
  • %S β€” seconds, leading 0's
  • %t β€” TAB
  • %T β€” time format: 21:05:57
  • %U β€” week number, Sunday as first day of week
  • %v β€” DD-Mon-Year
  • %w β€” day of the week, numerically, Sunday == 0
  • %W β€” week number, Monday as first day of week
  • %x β€” date format: 11/19/94
  • %X β€” time format: 21:05:57
  • %y β€” year (2 digits)
  • %Y β€” year (4 digits)
  • %Z β€” timezone in ascii. eg: PST

πŸ’… DESCRIPTION πŸ’…

This module provides routines to format dates. They correspond to the libc routines. &strftime() supports a pretty good set of conversions -- more than most C libraries. πŸ”₯

strftime supports a pretty good set of conversions.

The POSIX module has very similar functionality. You should consider using it instead if you do not have allergic reactions to system libraries. πŸ™ˆ (ngl that's the whole vibe, iykyk)


πŸ‘‘ AUTHOR πŸ‘‘

Best Practical Solutions, LLC <modules@bestpractical.com>

🌈 ORIGINAL AUTHOR 🌈

David Muir Sharnoff

πŸŽ€ GENESIS πŸŽ€

The starting point for this package was a posting by Paul Foley. (the origin story fr fr ✨)


Copyright (C) 1996-2010 David Muir Sharnoff. Copyright (C) 2011 Google, Inc. Copyright (C) 2026 Best Practical Solutions, LLC.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


this page shipped with perl v5.40.1, dated 2026-02-28 β€” and that's the whole manual, bestie. slay, go format some timestamps, you're the main character now πŸ’–
πŸ“¦ where this page comes from