請問怎麼判斷今天是5.1,5.2,5.3或10.1,10.2,10.3。

才子鸣 2007-09-25 08:59:18
請問怎麼判斷今天是5.1,5.2,5.3或10.1,10.2,10.3。


意思就是說怎麼判斷國假5.1,5.2,5.3
10.1,10.2,10.3
元旦一天1.1

謝謝各位幫忙了!





目前你在CSDN社区有可用分:2259, 不好意思我在老版裡還有這麼多分。但新版裡沒分了。
在CSDN社区共有可用分(注:此分是指新版下的积分):100, 已花费可用分:100, 剩余可用分:0
...全文
118 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
jing12 2007-09-26
  • 打赏
  • 举报
回复
弄出来了就把贴结了吧!
tetsuya 2007-09-26
  • 打赏
  • 举报
回复
一般都是把写假期做在一张表里面的
不只是 5.1 和10.1 建议还是弄张表 .可以添加 .动态的去判断比较号
禹爸爸 2007-09-26
  • 打赏
  • 举报
回复
DecodeDate(Today, aYear, aMonth, aDay);
if (aMonth = 5) and (aDay in (1,2,3) then
//Labor day
else if (aMonth = 10) and (aDay in (1,2,3) then
//Nation Day
else if (aMonth = 1) and (aDay = 1) then
//Festival
ahjoe 2007-09-26
  • 打赏
  • 举报
回复
Date猎取当天日期.

DecodeDate分解日期为: 年 月 日

然后再判断是不是假期就很简单.
才子鸣 2007-09-25
  • 打赏
  • 举报
回复
aDay : array[0..6] of string = ('10/01','10/02','10/03','05/01','05/02','05/03','01/01'); //中國國假

if (DayOfWeek(Now) in [1,7]){雙休} or (AnsiIndexStr(FormatDateTime('MM/DD',StrToDateTime(lblShiftBeginTime.Caption)),aDay) <> -1) then

呵呵。我是這樣做的。
jing12 2007-09-25
  • 打赏
  • 举报
回复
今天是不是五一,可以有以下方式:
if FormatDateTime('mmdd',Now)='0501' then
//是5月1日
else
//不是

if (MonthOf(Now)=5) and (DayOf(Now)<=3) then
//是5月1-3日
else
//不是
//此例前题 uses DateUtils;
hangzhou_hammer 2007-09-25
  • 打赏
  • 举报
回复
==============

请问,如何注销 帐号;我也遇到你的事;由于前段时间遇到了 引起众愤的人,回复他几句,被管理员,直接 封号。分数我都是无所谓,但感觉,被欺压。我不知道哪些人是有全管理帐号的,请帮我把该帐号 删除吧 谢谢!!
hangzhou_hammer
虽然 有好几个三角了……
liuhaogang82 2007-09-25
  • 打赏
  • 举报
回复
不明白你的意思,是想问怎么知道今天是几月几号呢...还是说专门判断今天是不是放假...
如果是前者,你可以用FormatDateTime('m.d',Now)获取,后者不做回答,无意义
天行归来 2007-09-25
  • 打赏
  • 举报
回复
建立一张节日对照表

假日名称 假日日期
五一劳动节 05.01,05.02,05.03
国庆节 10.01,10.02,10.03
元旦 01.01
...

格式化当前日期,然后从对照表中检索当前的日期所处的假日名称及假日日期组成即可。
比如:
Pos(假日日期,FormatDateTime('mm.dd',Date))
或者
select * from 节日对照表 where 假日日期 like '%日期%'
THE BOOST C++ LIBRARIES是一份自己编译的chm格式文档,描述了如何使用boost类库,目录如下: Front page Chapter 1: Introduction 1.1 C++ and Boost 1.2 Development Process 1.3 Installation 1.4 Overview Chapter 2: Smart Pointers 2.1 General 2.2 RAII 2.3 Scoped Pointer 2.4 Scoped Array 2.5 Shared Pointer 2.6 Shared Array 2.7 Weak Pointer 2.8 Intrusive Pointer 2.9 Pointer Container 2.10 Exercises Chapter 3: Function Objects 3.1 General 3.2 Boost.Bind 3.3 Boost.Ref 3.4 Boost.Function 3.5 Boost.Lambda 3.6 Exercises Chapter 4: Event Handling 4.1 General 4.2 Signals 4.3 Connections 4.4 Exercises Chapter 5: String Handling 5.1 General 5.2 Locales 5.3 Boost.StringAlgorithms 5.4 Boost.Regex 5.5 Boost.Tokenizer 5.6 Boost.Format 5.7 Exercises Chapter 6: Multithreading 6.1 General 6.2 Thread Management 6.3 Synchronization 6.4 Thread Local Storage 6.5 Exercises Chapter 7: Asynchronous Input and Output 7.1 General 7.2 I/O Services and I/O Objects 7.3 Scalability and Multithreading 7.4 Network Programming 7.5 Developing Boost.Asio Extensions 7.6 Exercises Chapter 8: Interprocess Communication 8.1 General 8.2 Shared Memory 8.3 Managed Shared Memory 8.4 Synchronization 8.5 Exercises Chapter 9: Filesystem 9.1 General 9.2 Paths 9.3 Files and Directories 9.4 File Streams 9.5 Exercises Chapter 10: Date and Time 10.1 General 10.2 Calendar Dates 10.3 Location-independent Times 10.4 Location-dependent Times 10.5 Formatted Input and Output 10.6 Exercises Chapter 11: Serialization 11.1 General 11.2 Archive 11.3 Pointers and references 11.4 Serialization of class hierarchy objects 11.5 Wrapper functions for optimization 11.6 Exercises Chapter 12: Parser 12.1 General 12.2 Extended Backus-Naur Form 12.3 Grammar 12.4 Actions 12.5 Exercises Chapter 13: Containers 13.1 General 13.2 Boost.Array 13.3 Boost.Unordered 13.4 Boost.MultiIndex 13.5 Boost.Bimap 13.6 Exercises Chapter 14: Data Structures 14.1 General 14.2 Boost.Tuple 14.3 Boost.Any 14.4 Boost.Variant 14.5 Exercises Chapter 15: Error Handling 15.1 General 15.2 Boost.System 15.3 Boost.Exception Chapter 16: Cast Operators

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧