Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8967193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:11:25+00:00 2026-06-15T17:11:25+00:00

Is it possible to convert timi milis since the epoch in Perl using Time::Local

  • 0

Is it possible to convert timi milis since the epoch in Perl using Time::Local or another package that is included with the standard Perl distribution, i.e. which doesn’t have to be added separately using a package manager like ppm? The problem is, I work in a super-restricted network environment and the script I am writing doesn’t warrant going through the red tape to get something external like DateTime or Time::HiRes.

E.g., I have milis like 1354996539 and I would like to format it to 2012-12-11 13:45:34

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:11:26+00:00Added an answer on June 15, 2026 at 5:11 pm

    Time::Local’s timelocal does the opposite of what you want (1354996539 is the output, not the input). The function after which it’s named, localtime, is actually the one you want.

    use POSIX qw( strftime );
    say strftime('%Y-%m-%d %H:%M:%S', localtime(1354996539));
    

    Outputs (for someone in America/Toronto):

    2012-12-08 14:55:39
    

    You can also do it without strftime:

    my @ts = localtime(1354996539);
    $ts[4] += 1;
    $ts[5] += 1900;
    say sprintf('%d-%02d-%02d %02d:%02d:%02d', @ts[5,4,3,2,1,0]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to convert HTML + CSS into HTML for a system that
Possible Duplicate: Convert a Unix timestamp to time in Javascript I am trying to
Possible Duplicate: convert string to 2D array using php I have the string like
Possible Duplicate: Convert HTML to PDF in .NET I am using VSTS 2008 +
Possible Duplicate: convert xml to jsonx using xslt Can anyone help me out in
How can one with minimal effort (using some already existing facility, if possible) convert
Possible Duplicate: Convert one date format into another in PHP I know there are
Possible Duplicate: Convert a number range to another range, maintaining ratio So I have
Possible Duplicate: Convert one date format into another in PHP Starting from: $date =
Possible Duplicate: Convert a Unix timestamp to time in Javascript Turn a unix timestamp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.