首页
\
问答
\
如何获得下个月的第1,第2,第3,第4个工作日(工作日)(How to get 1st, 2nd, 3rd, 4th business day (week day) for next month)
如何获得下个月的第1,第2,第3,第4个工作日(工作日)(How to get 1st, 2nd, 3rd, 4th business day (week day) for next month)
我一直试图找到下个月的第1,第2,第3或第4个工作日/工作日(工作日)的日期。
我有以下代码:
NSTimeInterval *lastDue; // unix time stamp from last due date NSDate *ldue=[NSDate dateWithTimeIntervalSince1970:lastDue]; NSDateComponents *dc =[calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSWeekdayCalendarUnit|NSWeekdayOrdinalCalendarUnit) fromDate:ldue]; NSLog(@"firstWeekday: %ld",(long)dc.weekday);
任何人有任何提示从哪里开始?
谢谢
I have been trying to find what is the date of the 1st, 2nd, 3rd or 4th business/working day (weekday) for next month.
I have the following code:
NSTimeInterval *lastDue; // unix time stamp from last due date NSDate *ldue=[NSDate dateWithTimeIntervalSince1970:lastDue]; NSDateComponents *dc =[calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSWeekdayCalendarUnit|NSWeekdayOrdinalCalendarUnit) fromDate:ldue]; NSLog(@"firstWeekday: %ld",(long)dc.weekday);
Anyone has any tips where to start?
Thank you
原文:https://stackoverflow.com/questions/23385521
更新时间:2023-04-14 10:04
最满意答案
wxWidgets 3.0中不存在dbgrid库。 我不知道它的引用来自哪里,但你应该只是从你的项目中删除它。
The dbgrid library doesn't exist in wxWidgets 3.0. I don't know where does the reference to it come from, but you should simply remove it from your project.
相关问答
更多-
在语言层面上,没有银弹。 你所能做的最好的就是尽可能地遵守语言标准。 如果利用特定编译器特定的扩展(使用Visual C ++, /Za将禁用非标准语言扩展),大多数编译器都可以选择发出警告或错误。 但这并不完美,因为没有编译器实现绝对100%的标准,所以即使使用严格符合的代码,仍然可能存在可移植性问题。 另外请注意,大量的日常代码实际上会利用扩展或未定义的或编译器定义的行为,而往往没有意识到它,所以在完全符合标准的模式下编译可能不切合实际。 您还必须了解标准允许的不同之处。 例如,像int这样的类型在不同 ...
-
Suma的解决方案看起来很有前途,但它不起作用: __imp__*@4符号需要是指向函数的指针 ,而不是函数本身。 不幸的是,我不知道如何使Visual C ++吐出一个具有这种名称生成的指针...(好吧, __declspec(naked)与__stdcall结合起来,但是我不知道如何发出指针)。 如果在构建时使用汇编器是可行的,解决方案是非常简单的 - 使用FASM组装以下代码并链接到生成的对象文件,并在exe中预先编写EncodePointer / DecodePointer引用: use32 for ...
-
您没有实现复制构造函数和复制赋值运算符(请参阅三条规则)。 这会导致向量中指针的浅拷贝,导致双重删除和断言。 编辑:双删除是未定义的行为,所以VS和gcc在这里都是正确的,他们被允许做任何他们想要的。 通常,当你实现具有不平凡行为的析构函数时,还需要编写或禁用复制构造和复制分配。 但在你的情况下,你是否真的需要通过指针来存储项目? 如果没有,只要按价值存储它们,那就能解决问题。 否则,如果您确实需要指针,请使用shared_ptr (来自您的编译器或boost)而不是原始指针,以免您需要编写自己的析构函数/ ...
-
不应该这样 #include "MyProjectDcomSchnittstellenTypdefinitionen.idl" #include "IObj1ManagerMyProject.idl" #include "IObj1ManagerMyProjectEvents.idl" #include "IObj2Manager.idl" #include "IObj2NotifySink.idl" 实际上就是这样 import "MyProjectDcomSchnittstellenTypdefi ...
-
howmany需要保持不变,并且需要定义一定数量,如下所示: const unsigned int howmany = 5; std::vector
* array_adresses[howmany]; 或者您可以像这样动态定义它: unsigned int howmany = 5; std::vector * array_adresses = new std::vector [howmany]; howmany needs to be constant, and needs t ... -
Visual Studio 2010中shared_ptr的编译器错误(compiler error for shared_ptr in Visual Studio 2010)[2021-12-15]
您可能尝试交换两个不兼容类型的shared_ptr 。 确保两个shared_ptr指向相同/可转换类型的对象。 You probably try to swap two shared_ptr of incompatible types. Make sure that the two shared_ptr point to objects of the same/convertible type. -
Visual Studio 2015 Update 1中的C ++出现内部编译器错误(Internal Compiler Error with C++ in Visual Studio 2015 Update 1)[2023-01-20]
升级到MSVC 2015更新1后,我们在其中一个项目中遇到了C1001。 通过反复试验,我们发现ClCompile/AssemblerOutput属性是我们案件中的罪魁祸首。 删除此属性不再导致C1001 来源: https : //trac.osgeo.org/mapguide/ticket/2580 2016年4月6日更新:我尝试使用MSVC 2015 Update 2构建相同的项目, ClCompile/AssemblerOutput删除ClCompile/AssemblerOutput属性,并且在构 ... -
Visual Studio 2010自动切换到C ++ / CLI编译器(Visual studio 2010 automatically switched to C++/CLI compiler)[2021-03-10]
从菜单栏中选择Project - > Properties 。 在“ Project properties窗口的“ Configuration Properties - >“ General ,确保“ Common Language Runtime Support设置为“ No Common Language Runtime Support 。 Choose Project -> Properties from the menu bar. In the Project properties window, ... -
wxWidgets 3.0中不存在dbgrid库。 我不知道它的引用来自哪里,但你应该只是从你的项目中删除它。 The dbgrid library doesn't exist in wxWidgets 3.0. I don't know where does the reference to it come from, but you should simply remove it from your project.
-
Visual C ++ 2008/2010编译器如何优化?(How well does the Visual C++ 2008/2010 compiler optimize?)[2023-10-16]
编译器的默认设置为生成可在“最低公分母”CPU上运行的代码 - 即没有SSE 4.1指令的代码。 您可以通过仅在构建选项中定位更高版本的CPU来改变这一点。 也就是说,MSE编译器在SSE优化方面传统上“不是最好的”。 我甚至不确定它是否支持SSE 4。 该链接为GCC进行SSE优化提供了良好的信誉: 作为关于GCC在代码生成方面近乎完美的一个注意事项 - 我甚至惊讶地看到它超越了英特尔自己的编译器 也许你需要改变编译器! The default for the compiler is set to gen ...