timetrans(3)

πŸ“¦
version 2.2.3 Β· 3 versions
, in arch rolling

πŸ’– timetrans(3) β€” Net::DNS::SEC::Tools::timetrans πŸ’–

okay bestie, so this is a page from User Contributed Perl Documentation, and it's literally the timetrans(3) man page. it's giving "small module, big 'how many days is that actually' energy" and honestly? we stan a unit converter. πŸ•βœ¨


🌸 NAME 🌸

Net::DNS::SEC::Tools::timetrans β€” turns an integer seconds count into text units. that's it, that's the whole gig. no cap. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

use Net::DNS::SEC::Tools::timetrans;

$timestring = timetrans(86488);

$timestring = fuzzytimetrans(86488);

two functions, one use line, we love a low-maintenance import. πŸŽ€


✨ DESCRIPTION ✨

so the timetrans() interface in Net::DNS::SEC::Tools::timetrans takes an integer seconds count and converts it into the equivalent number of days, hours, and minutes. key detail bestie: the time converted is a relative time, not an absolute time. it's a duration, not a timestamp, iykyk. ⏳

the returned time comes back in terms of days, hours, minutes, and seconds β€” exactly as many of those as are needed to express the seconds count appropriately. so like, don't expect it to pad out all four if it doesn't need to.

then there's fuzzytimetrans(), the chill one 😌 β€” it converts an integer seconds count into the equivalent number of weeks or days or hours or minutes. whichever unit is most natural for that seconds count gets picked. and it includes one decimal place of precision in the result. so you get the vibe, not the exact receipts. πŸ“Š


🌈 INTERFACES 🌈

the interfaces to the Net::DNS::SEC::Tools::timetrans module are given below. let's get into it 🫢

πŸŽ€ timetrans()

this routine converts an integer seconds count into the equivalent number of days, hours, and minutes. the converted seconds count gets returned as a text string. heads up though: the seconds count must be greater than zero, or an error will be returned. 🚨

Return Values:

  • if a valid seconds count was given, the count converted into the appropriate text string will be returned. πŸ’–
  • an empty string is returned if no seconds count was given, or if the seconds count is less than one. (yes, that includes zero. zero is not invited to this party. πŸ™ˆ)

🧚 fuzzytimetrans()

this routine converts an integer seconds count into the equivalent number of weeks, days, hours, or minutes. the converted seconds count gets returned as a text string. same rule applies: the seconds count must be greater than zero, or an error will be returned. ⚠️

Return Values:

  • if a valid seconds count was given, the count converted into the appropriate text string will be returned. πŸ’œ
  • an empty string is returned if no seconds count was given, or if the seconds count is less than one. same energy as above, fr fr.

πŸ”₯ EXAMPLES πŸ”₯

okay this is the fun part, watch the conversions go off πŸ‘‘

timetrans(400) returns 6 minutes, 40 seconds
timetrans(420) returns 7 minutes
timetrans(888) returns 14 minutes, 48 seconds
timetrans(86400) returns 1 day
timetrans(86488) returns 1 day, 28 seconds
timetrans(715000) returns 8 days, 6 hours, 36 minutes, 40 second
timetrans(720000) returns 8 days, 8 hours

and now the fuzzy icons, serving rounded decimals πŸ“

fuzzytimetrans(400) returns 6.7 minutes
fuzzytimetrans(420) returns 7.0 minutes
fuzzytimetrans(888) returns 14.8 minutes
fuzzytimetrans(86400) returns 1.0 day
fuzzytimetrans(86488) returns 1.0 day
fuzzytimetrans(715000) returns 1.2 weeks
fuzzytimetrans(720000) returns 1.2 weeks
and yeah, 40 second is singular up there in the 715000 example β€” that's exactly how it's written, bestie. not a typo on my end, that's the source being the source. πŸ’€

Copyright 2004-2014 SPARTA, Inc. All rights reserved. for the details, see the COPYING file included with the DNSSEC-Tools package. legal stuff, but make it cute. πŸ“œ


πŸ’« AUTHOR πŸ’«

Wayne Morrison, tewok@tislabs.com β€” shoutout to the main character who wrote this. 🌟


πŸ’… SEE ALSO πŸ’…


mwah πŸ’‹ that's the whole page! this one shipped as perl v5.44.0, dated 2026-10-17 β€” go forth and convert your seconds, bestie, the units are waiting πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from