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 8936375
In Process

The Archive Base Latest Questions

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

I realize that Perl has strftime, which allows you to pass a formatting object.

  • 0

I realize that Perl has strftime, which allows you to pass a formatting object. The functionality I’m wondering if I can find is more like the following (from PHP):

$string1 = "Jun 6, 2012";
$string2 = "June 06 2012";
if (strtotime($string1) == strtotime($string2)) {
  echo "BLAMMO!";
}
// will echo "BLAMMO!"

The reason for this is a business need in which user-provided dates need to be compared for validation and extended logic (does this date fall within another daterange also provided, etc). Now, I realize I can write an entire library devoted to doing this, and I realize there are any number of potential pitfalls with date-parsing and you should never trust user input, but here are some basic assumptions.

  1. The input is actually output from any number of software packages that conform to their own internal specifications for date formatting. They all follow some standard, but those standards are not uniformly normalized between programs. That being said, I should always be comparing two dates from the same program, but I may never know what format they may follow.
  2. I realize the standards of any given system are likely to be different, but the assumption here is that we’re feeding ALL of our dates into the same thing, so we can trust a consistent implementation, hopefully something in CPAN or another easily updated module.
  • 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-15T10:12:12+00:00Added an answer on June 15, 2026 at 10:12 am

    Date::Parse supplies str2time, which does this.

    The documentation lists some examples that the module can parse:

     1995:01:24T09:08:17.1823213           ISO-8601
     1995-01-24T09:08:17.1823213
     Wed, 16 Jun 94 07:29:35 CST           Comma and day name are optional 
     Thu, 13 Oct 94 10:13:13 -0700
     Wed, 9 Nov 1994 09:50:32 -0500 (EST)  Text in ()'s will be ignored.
     21 dec 17:05                          Will be parsed in the current time zone
     21-dec 17:05
     21/dec 17:05
     21/dec/93 17:05
     1999 10:02:18 "GMT"
     16 Nov 94 22:28:20 PST 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write a perl program that accept command lines arguments which can
I realize that a SO user has formerly asked this question but it was
I realize that TWTweetComposeViewController is new to iOS 5 (which is now a bit
I realize that this question has been asked 100times but none that I have
I realize that it can depend on certain things (and obviously how efficient the
I realize that evaluating an array in Perl in a scalar context is useful:
Using Perl's XML::LibXSLT necessitates that I use XSLT 1.0, which means that I am
I try to realize simple code on perl which should just get/send messages from/to
I was wondering if it was possible to manually wake a perl script that
I wrote a program that is using the Perl POE Framework to realize a

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.