如何在UTC,GMT,PST,MST,EST,CST等不同时区运行调度程序。 [英] How to run a scheduler on different time zones like UTC, GMT, PST, MST, EST, CST etc..

查看:1060
本文介绍了如何在UTC,GMT,PST,MST,EST,CST等不同时区运行调度程序。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库,其中包含来自不同国家的不同用户,这些用户已在我们的应用程可能有用户在不同国家/地区拥有朋友。



比如说,有3个用户A,B,C。 A在印度,B在旧金山,C在意大利,A,B,C三者都是朋友。



A的生日是29/08 / 2014年。

因此,在2014年8月29日上午12:00:00(A的时区),我需要通过服务器向B&C发送A的生日通知,关于A的时区。



如果我选择每天在服务器上午12:00:00运行调度程序,它可能与A的时区不同。它可能是在A时区之前或之后的几分钟。但我只需要在A的时区发送通知。



我需要实现此功能。如果有人能帮助我,我会很高兴。



请帮我实现这个功能。



提前致谢。



Suresh

I have a database of different users from different countries who had registered in our application. There might be the users having friends in different countries.

Say, there are 3 users A, B,C. A is in India, B is in San Francisco and C is in Italy and A, B, C all three are friends.

A's birthday is on 29/08/2014.
So, on 29/08/2014 at 12:00:00 AM (A's time zone), i need to send B & C the A's birthday notification via server with respect to A's time zone.

In case if i had chosen to run a scheduler everyday at 12:00:00 AM server time, it might not be the same as A's time zone. It might be few minutes before or after the A's time zone. But i need to send the notification only at A's time zone.

I need to achieve this functionality. I would be very glad if someone can please help me.

Please help me in achieving this functionality.

Thanks in advance.

Suresh

推荐答案

请看在其中 [ ^ ]。


确保所有相关时间在数据库中存储为UTC值。然后,当您运行提醒过程时,您只需要将用户条目与当前UTC时间进行比较,它就能正常工作。
Make sure that all the relevant times are store as UTC values in your database. Then, when you run your reminder process you just need to compare the user entry with the current UTC time, and it will work correctly.


这篇关于如何在UTC,GMT,PST,MST,EST,CST等不同时区运行调度程序。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆