Friday 22 January 2010

Dates and Times, how do you handle them?

So my last post on dates and times got me thinking, how is everyone else dealing with them for international type applications. I am now curious how people store, report on, use dates and times.

So if you had a "Global" application, where the users are in any timezone what would you...

  1. Store in the documents
  2. Use for views
  3. Use for calculations
  4. Include in emails
  5. Deal with front end and server side use
Having exchange a few mails recently it seems that people do things differently. Some store in local, some convert to GMT/UTC, some store mulitple dates in different formats.

Please leave a comment!

Wednesday 20 January 2010

Notes and Timezones!

I have a rather difficult issue to resolve, well in my mind it is, it may well not be! "Time Zones!"

I have a system that is a global application, it can be used via a browser or via a notes client The system stores lots of dates to track SLA's and the SLA's themselves are computed based on the day of the week and the time of day. Normally storing dates is fine, you use a date/time field and leave notes to handle the display. Unfortunately the SLA issue here causes me a problem.

So here is where it get's complicated, all the dates/times need to be in CET (Amsterdam) no matter where they are set.

  1. The server is in UK running GMT
  2. Users from the web will use local time on Client machine which could be any time zone but dates can potentially be calculated in WQS agent on server
  3. Administrators can be anywhere but will use a Notes Client
  4. Reporting must be in CET (Amsterdam)
So when a document is created via web or client, the SLA's need to be looked up based on the hour of day and day of week as I said. This must be based on CET (Amsterdam) no matter what the local time zone of the user is or server is.
Now I thought I had something working until I turned my local machines clock forward to April, which of course is GMT+1. Now my CET dates/times are still showing GMT +1 and not taking DST into account. I guess I need to know if the date/time in Amsterdam is DST even if the machine running the code is in New York for example.
So currently my codwould show 01/01/2010 19:00 GMT as 01/01/2010 20:00 CET but 01/04/2010 1900 GMT+1 shows as 01/04/2010 CET as DST is not being taken into account.
I have to admit this is driving me nuts!
So any advice? Ideas?

Saturday 2 January 2010

The year that was 2009

Like just about everyone else who has a blog I thought I would reflect on the last year, if nothing else for my own sanity. A year that proved to have highs and incredible lows for me. This is a personal reflection on my life and not on technology or the world at large.

For the first time in 2008 I had spent Christmas away from home with my mother, her partner, my aunt and her family and of course my family including Duke our dog. We had rented some cottages down in Somerset and had a really nice time. It turned out to be a very important memory for me and one I will always cherish.

Work has been a challenge in 2009. Having had to cope with increased demand, fewer resources, it was tough. I found myself working 10 - 12 hour days as the norm and had very little time to myself for anything except work.

The summer proved to be a damp affair and as such I really didn't get out on the motorbike much this year. The Kill spills organisation that I have marshalled for at various events over the last 4 years did not have any events this year and they are something I usually look forward to. Maybe next year, who knows.

Of course the major events of 2009 were very personal in nature. My mother was diagnosed with Lung Cancer in August and less than a month later she died suddenly. I have covered this is detail in a previous post but this was obviously a heart breaking event. The day after my mothers funeral we lost our dog Duke, another very distressing event. It seemed that 2009 was destined to end on a bad note. Two weeks after that my son was in a bad car accident when a friend of his lost control of his car and flipped it. My son wasn't wearing a seat belt but thank god he didn't get flung from the car or crushed under it and walked away with minor injuries.

This Christmas has been depressing and difficult. My mother was missing and she loved this time of year. I am so glad that we spent last year together as a family. Duke loved Christmas as well and would go mad ripping the paper of his new toy each year but again that was missing. In fact the magic of Christmas has been slowly fading as the years go by. I don't know why, I always loved this time of year, but now it just seems like a big panic for weeks or months then a day later it's all over. The sad thing is I "really want" to enjoy the festive season but I just can't. I wish it was like one of those family movies where everyone is happy and Santa flies over the house on his sleigh shouting ho ho ho, but life isn't like that.

Just so I don't finish on the doom and gloom, there were some highlights for 2009. I had my first (and so far only) flying lesson in an old beaten up Cessna 152 out of Blackbushe. I also turned semi-professional in my photography and have enjoyed that immensely. Both things I hope to continue in the future. I've made lots of new friends online in twitter and also reconnected with old friends from my school days. Now I need to stop living in the past and try to get on with the future.