{
    "mode": "perldoc",
    "parameter": "Time::Seconds",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Time%3A%3ASeconds/json",
    "generated": "2026-06-09T23:46:57Z",
    "synopsis": "use Time::Piece;\nuse Time::Seconds;\nmy $t = localtime;\n$t += ONEDAY;\nmy $t2 = localtime;\nmy $s = $t - $t2;\nprint \"Difference is: \", $s->days, \"\\n\";",
    "sections": {
        "NAME": {
            "content": "Time::Seconds - a simple API to convert seconds to other date values\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Time::Piece;\nuse Time::Seconds;\n\nmy $t = localtime;\n$t += ONEDAY;\n\nmy $t2 = localtime;\nmy $s = $t - $t2;\n\nprint \"Difference is: \", $s->days, \"\\n\";\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module is part of the Time::Piece distribution. It allows the user to find out the number\nof minutes, hours, days, weeks or years in a given number of seconds. It is returned by\nTime::Piece when you delta two Time::Piece objects.\n\nTime::Seconds also exports the following constants:\n\nONEDAY\nONEWEEK\nONEHOUR\nONEMINUTE\nONEMONTH\nONEYEAR\nONEFINANCIALMONTH\nLEAPYEAR\nNONLEAPYEAR\n\nSince perl does not (yet?) support constant objects, these constants are in seconds only, so you\ncannot, for example, do this: \"print ONEWEEK->minutes;\"\n",
            "subsections": []
        },
        "METHODS": {
            "content": "The following methods are available:\n\nmy $val = Time::Seconds->new(SECONDS)\n$val->seconds;\n$val->minutes;\n$val->hours;\n$val->days;\n$val->weeks;\n$val->months;\n$val->financialmonths; # 30 days\n$val->years;\n$val->pretty; # gives English representation of the delta\n\nThe usual arithmetic (+,-,+=,-=) is also available on the objects.\n\nThe methods make the assumption that there are 24 hours in a day, 7 days in a week, 365.24225\ndays in a year and 12 months in a year. (from The Calendar FAQ at\nhttp://www.tondering.dk/claus/calendar.html)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Matt Sergeant, matt@sergeant.org\n\nTobias Brox, tobiasb@tobiasb.funcom.com\n\nBalázs Szabó (dLux), dlux@kapu.hu\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "Copyright 2001, Larry Wall.\n\nThis module is free software, you may distribute it under the same terms as Perl.\n",
            "subsections": []
        },
        "Bugs": {
            "content": "Currently the methods aren't as efficient as they could be, for reasons of clarity. This is\nprobably a bad idea.\n",
            "subsections": []
        }
    },
    "summary": "Time::Seconds - a simple API to convert seconds to other date values",
    "flags": [],
    "examples": [],
    "see_also": []
}