PAL CARD CATALOG ENTRY

SHORT DESCRIPTION

Validate and convert date formats


MOVEMENT WITHIN THE PAL CARD CATALOG
Move to top-level taxonomy
Move to keyword list

ASSET PROFILE

UNIT NAME
Date_Formatter_Package
VERSION
1
REVIEW CODE
C1 1.0 A
INET ADDRESS
sun1.disacim.osd.mil (134.152.9.140)
AUTHOR
U.S. Army Information System Engineering Command
Ft. Belvoir, VA 22060-5456
RIGHTS
Approved for Public Release; Distribution Unlimited
COPYRIGHT
None -- Public Domain.
DATE CREATED
April 12, 1990
DATE RELEASED
January 17, 1994
DATE LAST UPDATED
January 17, 1994
LOCATION
DSRS Library
PAL
ENVIRONMENT
MicroVax II Version 2.1/VMS and Zenith 248-Z PC.
LIMITATIONS
None.
CERTIFICATION
Ada System Certifier_1 1.0
Date/Time of Processing: Wednesday 25 May       1994 02:11:49Pm
Overall Assessment of System: OK
Classification of System: A
Basis of Classification --
Syntax Errors                               PASS
Completeness                                PASS
Independence from External Libraries        PASS
Independence from a Specific Ada Compiler   PASS

Number of ...
Files               2
Library Units       4
Lines            3250
Statements        739
Comments         1599

FILE LISTING

Directory Display


languages/ada/swcomps/dsrs/dateform:
  File Name                 Size
  ---------                 ----
  dateform.zip            28,728

languages/ada/swcomps/dsrs/strutil2:
  File Name                 Size
  ---------                 ----
  strutil2.zip            25,708


Totals
  ==============  ==============
    2 Files               54,436

ABSTRACT

                             Date_Formatter_Package
                                   01D001OQ.1
                               (Old ID: RIB0009A)
PURPOSE/INTENDED USE:
Date_Formatter_Package is an Ada package that provides subprograms for
validating dates in various formats and converting between formats. The
validation and conversion subprograms work only on variables of types
defined in this specification. All conversion subprograms call the
proper validation subprogram for the input date type format. 

The date formats and the associated type supported by package
Date_Formatter_Package are in month, day, year order and are as follows:

    Description                  Example                  Type             
 Numeric_Date_String       "010188"               Numeric_Date_String_Type 
                                                  is new String (1..6);    
 Abbreviation_Date_String  "Jan011988"            Abbreviation_Date_String_
                                                  Type is new String (1..6)
 Numeric_Date               1                     Numeric_Date_Subtype     
                                                  is Natural range 1..366; 
 Date_Record                Month => "January  "  Date_Record_Type is record
                            Day   => 1              Month : Month_Subtype; 
                            Year  => 1988           Day   : Day_Subtype;   
                                                    Year  : Year_Subtype;  
 Full_Date_String          "January 1, 1988"      String;                  

EXAMPLE APPLICATIONS:
Reuse of this asset would be appropriate for a system required to
validate date data and convert it to another format, for report or
database storage. 

CERTIFICATION LEVEL:
Date_Formatter_Package is certified at Level 4.  This means that the
Defense  Information Systems Agency/Center for Information Management
Software Reuse  Program (SRP) management office has successfully
compiled the code of this  Reusable Software Asset (RSA) and measured
maintainability, portability,  reliability and reusability.  In
addition, this RSA includes a test suite and a  Reuser's Manual, which
will be provided when the asset is extracted. 
 
IMPLEMENTATION ISSUES:
Date_Formatter_Package depends on (withs) String_Utilities_Package
(01D001OV) and the Ada predefined package Text_Io. 

Date_Formatter_Package defines the exceptions Invalid_Date and
Invalid_Setup.

HARDWARE/ENVIRONMENT CONSTRAINTS AND LIMITATIONS:
This package was compiled on the MicroVax II Version 2.1 under VMS and
Zenith 248-Z PC. 

SUBUNITS:
Date_Formatter_Package has the following visible subunits:
  Set_Current_Year_String_And_Valid_Year_Range 
            Modifies the global Current_Year_String and the valid year 
            ranges for this package.
  Valid_Date (overloaded) Validates a date (in Numeric_Date_String, 
            Abbreviation_Date_String, Full_Date_String, Date_Record, 
            or Numeric_Date format).
  Numeric_Date_String_To_Abbreviation_Date_String 
            (overloaded) Converts a date of type Numeric_Date_String to
            type Abbreviation_Date_String or type string.
  Numeric_Date_String_To_Date_Record 
            Converts a date of type Numeric_Date_String to type
            Date_Record.
  Numeric_Date_String_To_Numeric_Date 
            Converts a date of type Numeric_Date_String to type
            Numeric_Date.
  Abbreviation_Date_String_To_Numeric_Date_String 
            Converts a date of type Abbreviation_Date_String to type 
            Numeric_Date_String.     
  Abbreviation_Date_String_To_Full_Date_String 
            Converts a date of type Abbreviation_Date_String to type String.
  Abbreviation_Date_String_To_Date_Record 
            Converts a date of type Abbreviation_Date_String to type 
            Date_Record.
  Abbreviation_Date_String_To_Numeric_Date 
            Converts a date of type Abbreviation_Date_String to type 
            Numeric_Date.
  Full_Date_String_To_Numeric_Date_String 
            Converts a date of type String to type Numeric_Date_String.
  Full_Date_String_To_Abbreviation_Date_String 
            Converts a date of type String to type Abbreviation_Date_String.
  Full_Date_String_To_Date_Record 
            Converts a date of type String to type Date_Record.
  Full_Date_String_To_Numeric_Date 
            Converts a date of type String to type Numeric_Date.
  Date_Record_To_Numeric_Date_String 
            Converts a date of type Date_Record to type Numeric_Date_String.
  Date_Record_To_Abbreviation_Date_String 
            Converts a date of type Date_Record to type
            Abbreviation_Date_String
  Date_Record_To_Full_Date_String 
            Converts a date of type Date_Record to type String.
  Date_Record_To_Numeric_Date 
            Converts a date of type Numeric_Date to type Date_Record.
  Numeric_Date_To_Numeric_Date_String 
            Converts a date of type Numeric_Date to type
            Numeric_Date_String.
  Numeric_Date_To_Abbreviation_Date_String 
            Converts a date of type Numeric_Date to type 
            Abbreviation_Date_String.
  Numeric_Date_To_Full_Date_String 
            Converts a date of type Numeric_Date to type String.
  Numeric_Date_To_Date_Record 
            Converts a date of type Numeric_Date to type Date_Record.

DSRS CLASSIFICATION:
availability:  extractable
certification level:  level_4
component type:  implementation
data representation:  numeric
data representation:  record
data representation:  string
environment:  mvii/vms/vaxada
function:  convert
function:  format
function:  set
function:  validate
language:  ada
object:  date
object:  format
originator:  rapid
unit type:  package

LEGAL RESTRICTIONS:
This RSA contains public domain data with unlimited rights for all
users.   Extraction is permitted to all authorized library users. This
software and its documentation are provided "as is" and without any
expressed or implied warranties whatsoever.  No warranties as to
performance, merchantability, or fitness for a particular purpose exist.

The user is advised to test the software thoroughly before relying on
it.  The user must assume the entire risk and liability of using this
software.  In no event shall any person or organization of people be
held responsible for any direct, indirect, consequential or
inconsequential damages or lost profits. 

MISCELLANEOUS:
The standard for Level 4 certification has recently been upgraded. This
asset is currently undergoing modification to meet the new Level 4
requirements. 


REVISION HISTORY

January 17, 1994 Version 1 Original submission to PAL


RELEASE NOTICE

This prologue must be included in all copies of this software.
Restrictions on use or distribution:  NONE

LEGAL RESTRICTIONS:
This RSA contains public domain data with unlimited rights for all
users.   Extraction is permitted to all authorized library users. This
software and its documentation are provided "as is" and without any
expressed or implied warranties whatsoever.  No warranties as to
performance, merchantability, or fitness for a particular purpose exist.


DISCLAIMER

 This software and its documentation are provided "AS IS" and
without any expressed or implied warranties whatsoever.  No warranties
as to performance, merchantability, or fitness for a particular
purpose exist. 
 The user is advised to test the software thoroughly before
relying on it.  The user must assume the entire risk and liability of
using this software.  In no event shall any person or organization of
people be held responsible for any direct, indirect, consequential or
inconsequential damages or lost profits.