Sunday, 12 April 2009

Time coding

The following coding is used to display the date and last modified time:


(please click to enlarge)

It returns the time of the last modification of the ToDo List. The value returned is a Unix timestamp, suitable for feeding to date(). It returns FALSE on error. It would write to the todo.list file like this:

5||Feed Tarantulas|6|1247436000

The number "1247436000" translates to "10/08/09". This website will convert the Unix timestamp for you: www.unixtimestamp.com/index.php
This is one slight diviation from my original plan to just have the coding output the actual date not a timestamp. I found when writing the code that the timestamp was a better option.

No comments:

Post a Comment