Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Data manipulation

How to translate Excel dates to perl by prex1
Posted: 8 Oct 07 (Edited 9 Oct 07)

Excel stores dates as serial numbers, representing the number of days past one of two optional starting dates (the default in Windows is 00 Jan 1900, as day one is 1 Jan 1900).
Perl uses the number of seconds past the 'epoch', and the epoch on most systems is 1 Jan 1970.
To translate an Excel serial number to perl time, when the reference dates are the defaults as above, use the following


print scalar gmtime(($ExcelDate-25569)*86400);
This will display something like Fri Jul 27 09:39:11 2007, but may be rearranged by using the list output of gmtime() or localtime())

Back to Perl FAQ Index
Back to Perl Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close