tags:

views:

43

answers:

1

I want to calculate the allowance for a consultant traveling to overseas countries. I have to take into account that I can gain a day or lose a day travelling to international country. Different country has different set of allowance. How can I adjust my code to know whether I will gain a day or lose and adjust in my calculation? Please can anyone help me.

+2  A: 

Enter the dates/times using the local timezone information. Convert from that timezone to UTC for both dates/times and calculate the difference between the two based on UTC.

For example:

Left: 11/11/2008 10AM CST (Chicago) == 11/11/2008 4PM UTC (-6)

Arrived: 11/12/2008 5AM CET (Copenhagen) == 11/12/2008 4AM UTC (+1)

Difference = 12 hours

tvanfosson