确定每周的区域工作日和周末 [英] Determine regional business days and weekend days of the week
问题描述
在某些国家/地区,周末为星期五/星期六.
In some countries weekend days are Friday/Saturday.
Windows应用程序如何找出用户的周末?
How can a Windows application find out weekend days of the user?
推荐答案
Wellll ...我不知道对此有单一功能"的答案.您将需要知道它们的位置.如果是Web应用程序,则可以跟踪他们的IP并查明他们来自哪个国家.如果它是Windows应用程序,则可能需要询问它们(时钟仅提供时区信息,我不知道要从Windows那里获取更细粒度的位置).
Wellll...I don't know of a "One function" answer to this. You're gonna need to know where they are somehow. If it's a webapp, you can trace their IP and figure out what country they are from. If it's a windows app, you're probably going to need to ask them (The clock only provides timezone information, and i can't figure out where else to grab a more fine-grained location from windows).
您可以使用GetDayofWeek http://msdn.microsoft.com/zh-CN/library/1wzak8d0%28VS.80%29.aspx 在MFC中
You can figure out what day it is with GetDayofWeek http://msdn.microsoft.com/en-us/library/1wzak8d0%28VS.80%29.aspx in MFC
DayofWeek,如果您跳至.Net http://msdn. microsoft.com/en-us/library/system.dayofweek.aspx
DayofWeek if you hop to .Net http://msdn.microsoft.com/en-us/library/system.dayofweek.aspx
您将需要一个查找表,其中包含他们考虑的国家/地区/周末考虑的工作日..您可能必须构造此表,但是您可以从以下国家/地区获取国家/地区列表:
You'll need a lookup table with countries/what days they consider weekends..you'll probably have to construct this, but you can get a list of countries from: http://www.iso.org/iso/english_country_names_and_code_elements
该列表是ISO 3166.
That list is ISO 3166.
它已更新,应为您的清单一站式"商店.从那里,您将使周末"与各个国家/地区匹配. http://en.wikipedia.org/wiki/Workweek 可能有助于弄清周末/国家的工作周.
It's updated and should be your "one-stop-shop" for the listing. From there, you'll match "weekends" to the countries. http://en.wikipedia.org/wiki/Workweek might help in figuring out weekends/workweeks for countries.
这篇关于确定每周的区域工作日和周末的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!