English 中文(简体)
a天数据在分散的当地时间的价值
原标题:a days s worth of data in diff local times

我有一个双赢的客户和轮椅,共同显示历史数据。 储存在垃圾堆积中的数据。 如果不同时区的两名客户想要根据当地时间来审视最近一个数据价值,那么他们能否研究不同数据集?

最佳回答

这取决于。

  1. If "a day s worth" means "the last 24 hours", then they will both see the same data.
  2. If "a day s worth" means "00:00-23:59 of (current date - 1) in the user s local time zone", then they might see different data.

例:

      event 1      event 2       +---- service request
         |            |          v

|---------------|---------------|-  days in Central Europe

--------|-----------------|-------  days in the US (Pacific time)

---------------|---------------|--  UTC day boundaries

在第1起案件中,你在接到服务请求后24小时返回。 很容易看到,两个客户,即美国和欧洲的客户,将获得相同的活动清单。

在2起案件中,情况更加困难: 就美国时间而言,第1和第2项事件是同一天发生的。 就欧洲而言,这两起事件都是在不同的日子发生的,因此,美国客户和欧洲客户的结果将有所不同。

问题回答

如果没有进一步详情,答案就好了。

  1. 如果当地时间区有一天的定义,那么向散装货区提出请求之前,该日制格式就会改变。

  2. 如果问 题与否

    select * from dbTable where TimeStamp >=  9/22/2010  and TimeStamp <  9/23/2010  
    

    select * from dbTable where TimeStamp >= GetDate() -  24:00:00  and TimeStamp < GetDate() 
    

    then they will return the same set of data f或 both time zones.

It is certainly possible - it is one of the common issues with globalization/localization. The important thing to do is to convert all requests to UTC time before making the query. If the queries are all UTC-based, then the data returned to the local machines should match, as the UTC times will match.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签