Previous Section  < Day Day Up >  Next Section

Hack 18 Add Timestamps to mIRC Messages

figs/beginner.gif figs/hack18.gif

If you leave your IRC client running all the time, learn when each message was sent.

Many people leave their IRC client running 24 hours a day in order to receive private messages even during their absence. It also allows them to scroll up to see what conversations they have missed in all of their channels.

When you listen to a message on your voice mail, you are typically told when it was sent so you know how fresh the message is. If you've just come back from vacation, this can be useful so you know whether it's worth acting on each message. Similarly, it's useful to know when IRC messages were sent during your absence.

mIRC, the most popular Windows IRC client, doesn't display timestamps by default. Figure 4-4 shows mIRC running without displaying any timestamps. From this, it is impossible to know when Monty said, "hello," or when JimH quit from the network—maybe they happened in rapid succession; maybe they didn't. Fortunately, turning on and customizing mIRC timestamps is a piece of cake.

Figure 4-4. mIRC without timestamps

4.3.1 Adding Simple Timestamps

To turn on timestamps, open up the mIRC Options dialog, as shown in Figure 4-5, by choosing Tools Options from the menu bar. Navigate to the IRC Messages category and check the checkbox titled Timestamp Events. Now click on OK to close the dialog.

Figure 4-5. Enabling timestamping of events in mIRC

When you receive an event in mIRC now, it will be prefixed with a timestamp so you can see when the event occurred. Timestamps will be prefixed to all events, including public and private messages, joins, parts, quits, and so on.

Figure 4-6 shows the format of these timestamps in the main window.

Figure 4-6. mIRC displaying the default format for timestamps

4.3.2 Hacking the Timestamp

Sometimes you might want a greater resolution on your timestamps. After all, the difference between one second and one minute is quite significant when it comes to real-time chat. Conversely, you may like to use the timestamp to show what day it is. This can be useful if you are away from your IRC client for more than a day or if you simply keep forgetting what day it is.

To the right of the Timestamp Events checkbox in Figure 4-5, you can specify your own timestamp format using standard time and date identifiers. The default is [HH:nn], which displays the time in hours and minutes with leading zeros, for example [18:01].

Timestamps are best kept as short as possible, so it is probably not a great idea to include the full day name in them. Instead, you can use the short version (ddd), which also has the advantage of being the same length whatever day it is. Seconds (with a leading zero) can be added to the end of the timestamp using ss. So, to use this new and improved timestamp, you just have to enter the following:

[ddd HH:nn:ss]

This results in the style of timestamp shown in Figure 4-7.

Figure 4-7. mIRC timestamps now showing the day and seconds

Investigate the mIRC help file if you want to find out what other time and date modifiers are available. Some useful examples are h to display the hours on a 12-hour clock and tt to display am or pm.

    Previous Section  < Day Day Up >  Next Section