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

  • SEARCH
  • Home
  • 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 153837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:52:19+00:00 2026-05-11T09:52:19+00:00

How can I parse this date format that my web service is receiving in

  • 0

How can I parse this date format that my web service is receiving in JSON format in Perl? I’d like to convert it to a DateTime object:

Date(1216647000000-0400) 

I assumed it was milliseconds since the epoch along with a time zone offset but the dates are way off.

  • 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. 2026-05-11T09:52:20+00:00Added an answer on May 11, 2026 at 9:52 am

    The time is listed in milliseconds since the epoch. Divide by 1000 to get epoch seconds.

    Make sure this works with other cases you encounter:

    use DateTime;  my $json_date = 'Date(1216647000000-0400)'; if ($json_date =~ m{ \b (\d+) \b ([+-]\d\d\d\d\b)? }x ) {     my ( $epoch_milliseconds, $time_zone ) = ( $1, $2 );     my $dt = DateTime->from_epoch( epoch => $epoch_milliseconds / 1000 );     if ($time_zone) {         $dt->set_time_zone($time_zone);     }     print $dt->datetime; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any tool that can parse a valid C program and generate a
Is there a tool that can parse C++ files within a project and generate
Are there any .NET-specific tools out there that can parse / access the elementary
With the Cocoa framework how can I parse @2008-12-29T00:27:42-08:00 into an NSDate object? The
Can anyone recommend a ready-to-use class/library compatible with C/C++/MFC/ATL that would parse iCal/vCal/Google calendar
Is there an application , which can parse a given set of stored procedures
How can I parse the query string (GET / POST parameters) sent to an
How can I parse integers passed to an application as command line arguments if
Can anyone point me out, how can I parse/evaluate HQL and get map where
Can Spirit (part of Boost C++ library) be used to parse out binary data

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.