Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Perl module P216
Handling Dates and Time
Exercises, examples and other material relating to training module P216. This topic is presented on public course Perl bootcamp

Was 8 p.m. on 28th February in Los Angeles before or after 8 a.m. in Tokyo on 1st March? Perl has a very neat trick to handling dates and times, meaning that such questions can be easily resolved. We'll show you that trick, and we'll show you the various functions that you can use to handle dates and times in Perl.


Articles and tips on this subjectupdated
239What and why for the epoch
The Epoch occurred on 1st January 1970 ... at midnight, at the start of the day, GMT. It's an important concept in many programming languages, which work with times and dates before and after the epoch - it means that you can compare dates and times easily, even where month ends and different timezones ...
2008-05-16
 
765Perl - turning seconds into days, hours, minutes and seconds
So often you'll be working within a program in seconds - elapsed times, delays, that sort of thing - but want to report times back to the user in terms of hours, minutes and seconds. The conventional programming way to do this is to do a series of divisions and grab the remainder, but in Perl you can ...
2006-06-17
 
454Time conversions in Perl
Time isn't the easiest unit on which to do arithmetic, and dates expressed as a human-readable string are quite tricky to sort. Just imagine trying to write a program to work out whether 9 p.m. Pacific time on 28th Feb was before or after 3 a.m. in the UK on 1st March. And did you realise that, sorted ...
2006-06-05
 
Examples from our training material
chivvy   Using %SIG to timeout keyboard entry
dante   Date and time demos
dt1   file last modified (days ago)
dt2   dt2 - file last modified (seconds from 1.1.1970)
dt3   current date and time (system dependent!)
dt4   use of time and localtime
dt5   compare a stated date and time with now!
hf   Modified "chivvy" - perhaps less OS dependent
sigint   Use of Signals in Perl to trap ^C (Control C)
tim   Converting times between epoch seconds and regular time
Pictures
Perl - a modern language for ancient languages
Background information
This module is available under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
So far.
File status operators.
stat on a file.
Via system commands.
How Perl handles dates and times.
Other date information available.
Convertors.
Convert from epoch seconds into "human readable" form:.
Convert from human readable form to epoch seconds.
Handling centuries.
Elapsed time sleep.
alarm.
Summary.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/P216.html • PAGE BUILT: Wed Mar 6 10:39:20 2013 • BUILD SYSTEM: wizard