开发者

Birthday Reminder

i have implemented a windows service which is for user's birthday reminder. at midnight开发者_StackOverflow社区 this service sends a mail to the respective person who has birthday on that particular day. This is for users in India...

Now my requirement is to make that service for all users in the world... so what should I enhance in that service...? Because Indian time is different than other countries timings... If i fire that service at mid night as per indian time..it is possible that in india midnight means different timings in other countries... Plz suggest me a solution.


The best is to keep the time in UTC. In that case, you can convert the time back to the regional time as required.


show to birthday reminder on label

    DateTime birthday = Convert.ToDateTime("1991/12/24");
    int years = DateTime.Now.Year - birthday.Year;
    birthday = birthday.AddYears(years);
    DateTime check = DateTime.Now.AddDays(7);
    if ((birthday > DateTime.Now) && (birthday < check))
    {
        lbbirthday.Text = ("This week is your birthday !!!");
    }

for more details you can read show Birthday reminder in asp.net c#


You will need to store the users timezone offset and add/subtract this to your local time to know what time to fire off the email...

But to be honest would the user really care if the email arrived a few hours late or early, essentially it is still roughly the same day..


You can look for example here for the timezone conversion. But how do you know where the person is? Is it stored somewhere, if yes, you check it in what timezone is that location and send the e-mail according to it.


Mate, you are talking to programmer's. 99.9% of them are aware that there are different time-zones in the world. If you have information about the user's locations, you can use the information in this question to prove in which timezone a user lives and send the message an the timezone's midnight time: Web service - current time zone for a city?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜