TimeTeller - Read Me

Contents

-Introduction
-System requirements
-Command line arguments
-Examples
-Possible formats
-Copyright, contact information, etc.

Introduction

TimeTeller is a program which lets your computer tell you the date and or time. So now you think: why would I need such a program? I'll give you an example: being an amateur astronomer, I think it would sometimes be nice to know the exact time when doing some observation while not having time or hands left to look at my watch. So will this program help then? Well, not on its own. It will be most useful if you run it automatically, for example with Puac (an alarm clock program which I also wrote). I'm sure you'll be able to think up some other useful functions for it yourself.

The program should be run from a command line and can be run with several different command line arguments which I will discuss below.

System requirements

You'll need the SAPI 5.1 or later installed. This SAPI will do the actual speaking and can be downloaded from http://www.microsoft.com/speech/. This will also require a fast computer and some download time. The SAPI 5.1 also comes with Windows XP.

Command line arguments

Here I'll explain which command line arguments can be used, but maybe the examples will clear things up better.

First you have to specify the main command: 'now', 'custom', 'until' or 'since'. After that follows the sentence you want to be spoken between double quotes: " ". At every position in the sentence you want some portion of the date or time spoken, you have to specify the format between < >. Use the tables below to build the formats. With the commands 'custom', 'until' and 'since', you have to specify a date and/or time. When using the 'now' command, this date is set to the current date and time and you don't need to specify any date. For the 'custom' command the specified date/time which will be spoken. The 'until' and 'since' options use this date/time to calculate the difference between the current date and time and the specified date/time. Note that the formats used for the commands 'now' and 'custom' (first table) are different from the commands 'until' and 'since' (second table).

If no command line arguments are given or only the 'now' command is given, the program will use the following default arguments:
now "It's <h:mm am/pm> on <dddd, m/d/yyyy>."

When an error occurrs due to an error in the command line arguments, the program will say that an error occurred. If there is no SAPI 5.1 or later installed, the program will do nothing.

Examples

Here I'll give some examples of how to use the program. Here 'tt' is the name of the program.

tt now "The time is <h:n>."
(Says something like: "The time is 11:30")

tt now "Currently it's <n> minutes after the <h>th hour on the <d>th day of the month of <mmmm> in the year <yyyy>."
(Says something like: "Currently it's 30 minutes after the eleventh hour on the third day of the month of august in the year 2002")

tt custom "<m/d/yyyy> was on a <dddd>" "3/8/2002"
(Says: "August third, 2002 was on a Saturday". Note that depending on the date settings of your locale, dates will be recognized or spoken in month-day or day-month format. Experiment with this or use the yyyy/m/d as format. Also notice that the sentence to be spoken is: "8/3/2002 was on a Saturday", but dates are automatically recognized by the speech engine (in month-day format) and it says the date instead of the numbers and slashes.)

tt until "<d> days until Christmas" "25/12"
(Says something like: "144 days until Christmas")

tt until "T minus <s>" "3/8/2002 12:00:00"
(Says something like: "T minus 470")

tt since "This year I'll be <yyyy> years old" "03/08/2002"
(Says something like: "This year I'll be 0 years old". Note that "I'm <yyyy> years old" doesn't work as you might expect. Also note that 03/08/2002 should be your birth date.)

Possible formats

The date/time formats can of course be fully customized. The formats are shown in the table below, which I copied directly from documentation by Microsoft. The first table contains the possible formats you can use with the 'now' and 'custom' command, the second table contains the formats you can use with the 'until' and 'since' command.

Note that depending on the date settings of your locale, dates will be recognized or spoken in month-day or day-month format. Experiment with this or use the yyyy/m/d as format.

The following tables are copyright Microsoft:

_______________________________________________________________________________________

Character Description
(:) Time separator. In some locales, other characters may be used to represent the time separator. The time separator separates hours, minutes, and seconds when time values are formatted. The actual character used as the time separator in formatted output is determined by your system settings.
(/) Date separator. In some locales, other characters may be used to represent the date separator. The date separator separates the day, month, and year when date values are formatted. The actual character used as the date separator in formatted output is determined by your system settings.
c

Display the date as ddddd and display the time as
ttttt, in that order. Display only date information if there is no fractional part to the date serial number; display only time information if there is no integer portion.

d Display the day as a number without a leading zero (1 – 31).
dd Display the day as a number with a leading zero (01 – 31).
ddd Display the day as an abbreviation (Sun – Sat).
dddd Display the day as a full name (Sunday – Saturday).
ddddd Display the date as a complete date (including day, month, and year), formatted according to your system's short date format setting. For Microsoft Windows, the default short date format is m/d/yy.
dddddd Display a date serial number as a complete date (including day, month, and year) formatted according to the long date setting recognized by your system. For Microsoft Windows, the default long date format is mmmm dd, yyyy.
w Display the day of the week as a number (1 for Sunday through 7 for Saturday).
ww Display the week of the year as a number (1 – 54).
m Display the month as a number without a leading zero (1 – 12). If m immediately follows h or hh, the minute rather than the month is displayed.
mm Display the month as a number with a leading zero (01 – 12). If m immediately follows h or hh, the minute rather than the month is displayed.
mmm Display the month as an abbreviation (Jan – Dec).
mmmm Display the month as a full month name (January – December).
q Display the quarter of the year as a number (1 – 4).
y Display the day of the year as a number (1 – 366).
yy Display the year as a 2-digit number (00 – 99).
yyyy Display the year as a 4-digit number (100 – 9999).
h Display the hour as a number without leading zeros (0 – 23).
hh Display the hour as a number with leading zeros (00 – 23).
n Display the minute as a number without leading zeros (0 – 59).
nn Display the minute as a number with leading zeros (00 – 59).
s Display the second as a number without leading zeros (0 – 59).
ss Display the second as a number with leading zeros (00 – 59).
t t t t t Display a time as a complete time (including hour, minute, and second), formatted using the time separator defined by the time format recognized by your system. A leading zero is displayed if the leading zero option is selected and the time is before 10:00 A.M. or P.M. For Microsoft Windows, the default time format is h:mm:ss.
AM/PM Use the 12-hour clock and display an uppercase AM with any hour before noon; display an uppercase PM with any hour between noon and 11:59 P.M.
am/pm Use the 12-hour clock and display a lowercase AM with any hour before noon; display a lowercase PM with any hour between noon and 11:59 P.M.
A/P Use the 12-hour clock and display an uppercase A with any hour before noon; display an uppercase P with any hour between noon and 11:59 P.M.
a/p Use the 12-hour clock and display a lowercase A with any hour before noon; display a lowercase P with any hour between noon and 11:59 P.M.
AMPM Use the 12-hour clock and display the AM string literal as defined by your system with any hour before noon; display the PM string literal as defined by your system with any hour between noon and 11:59 P.M. AMPM can be either uppercase or lowercase, but the case of the string displayed matches the string as defined by your system settings. For Microsoft Windows, the default format is AM/PM.

Character Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week
h Hour
n Minute
s Second

_______________________________________________________________________________________

Copyright, contact information, etc.

You may freely distribute this program as long as you do not alter it and do not ask money for it. I cannot be held responsible for any problems the program causes.

See my website for updates, known problems, etc.
Please contact me if you have any suggestions, comments, questions, etc. Please consult the website first if you have a question.

Website: http://go.to/ph
E-mail: peters_productions@hotmail.com

Last update: 30-06-2004