Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Numeric Date Validation

by svsingh (Priest)
on Sep 30, 2003 at 15:18 UTC ( #295312=note: print w/replies, xml ) Need Help??

in reply to Numeric Date Validation

Here are some initial questions I had:
  • Will you be able to know the date format before parsing it? (Get the format from the user or a config file?) Or do you want to determine the format from the number?
  • Is there an expected range of valid dates? If it can be anything, then how do you want to handle cases where a single eight-digit number can be parsed into more than one valid date?

Replies are listed 'Best First'.
Re: Re: Numeric Date Validation
by booter (Novice) on Sep 30, 2003 at 15:41 UTC

    The date format can be one of the following


    In terms of range, the date can fall anywhere beween the present date (ie. 20030930, or is that 030930....see the difficulty?), and the most earliest date accepted, which is Jan 1st, 1900, so 19000101. Since a numberic cannot start with 0, this date cannot be represented by droping the century indicator (ie 19xx), so 000101 is not accepted.

    This is a bit difficult to implement as a numberic. Let me know if you have any ideas. Thanks for your feedback.

      20030102 -- January 2nd, or February 1st? Does it matter for your application?
        No, it doesn't matter what the actual date is, as long as it is a VALID date, so it could be January 2nd, or February 1st.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://295312]
[Corion]: Discipulus: I've looked for something but never found anything good
Corion looks at the SVG. If the different regions have IDs, then you can colorize the map by providing a CSS file with the colors.
[Corion]: Meh. IE crashes when displaying that SVG as saved from Firefox ...
LanX blame Canada!
[Discipulus]: to crash is not the default behaviour of IE? ;=)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2017-03-23 09:34 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (285 votes). Check out past polls.