The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Date::MSAccess - Manage dates in MS Access format


        use Date::MSAccess;

        my($obj)  = Date::MSAccess -> new();
        my($date) = $obj -> decode_date(37988); # Returns '20040101'.
        my($now)  = $obj -> todays_date();      # Returns 38006 on 20-Jan-2004.


Date::MSAccess is a pure Perl module.

It can convert a number which is an MS Access date into a string of the form 'YYYYMMDD'.

Also, it can return today's date in MS Access format.

Note: MS Access dates are based on 12 noon.

Note: MS Access dates can be fractional, eg 3008.25, but this module currently ignores such fractions.


This module is available both as a Unix-style distro (*.tgz) and an ActiveState-style distro (*.ppd). The latter is shipped in a *.zip file.

See for details.

See for help on unpacking and installing each type of distro.

Constructor and initialization

new(...) returns a Date::MSAccess object.

This is the class's contructor.

Usage: Date::MSAccess -> new().

This option does not take any values.

Method: decode_date(<A number corresponding to an MS Access date>)

Either returns a string of the form 'YYYYMMDD', or the string '00000000'.

The latter was chosen to be compatible with MySQL and Postgres 'timestamp' fields.

eg: decode_date(37988) returns '20040101'.

Method: todays_date()

Returns a number corresponding to today's date in MS Access format.

Eg: On 20-Jan-2004 the number returned was 38006.



Date::MSAccess was written by Ron Savage <> in 2004.

Home page:


Australian copyright (c) 2004, Ron Savage. All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License, a copy of which is available at: