起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 314|回复: 9

【搞定】如何取服务器时间的年度及月度**

[复制链接]
发表于 2006-11-15 14:38:37 | 显示全部楼层 |阅读模式
如何取服务器时间的年度及月度
回复

使用道具 举报

发表于 2006-11-15 14:40:18 | 显示全部楼层
?表达式那里函数的。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-15 14:45:59 | 显示全部楼层
是代码中,由date:=business.Data.SysSrv.SysService.Time;取出后想要分解成年度及月份
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-15 15:24:54 | 显示全部楼层

急啊!

没人答,顶一下.
另如何上继承的功能中调祖先功能主窗口中定义的方法,
回复 支持 反对

使用道具 举报

发表于 2006-11-15 15:40:25 | 显示全部楼层
日期有关的函数在 Business.System.DateUtils 单元中
你需要的是MonthOf
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-16 09:23:09 | 显示全部楼层
date:TDate;
date:=business.Data.SysSrv.SysService.Time;
year:=Business.System.DateUtils.DayOfTheYear(date);
    month:=Business.System.DateUtils.DayOfTheMonth(date);

SysUtils.IntToStr(year)
SysUtils.IntToStr(month)
仍无法取出正确的年度及月份?
回复 支持 反对

使用道具 举报

发表于 2006-11-16 09:36:06 | 显示全部楼层
是MonthOf,不是DayOfTheMonth(某个月份中有多少天)
Returns the month of the year represented by a TDateTime value.

Unit

DateUtils

Category

date/time routines

function MonthOf(const AValue: TDateTime): Word;

Description

Call MonthOf to obtain the month of the year represented by a specified TDateTime value. MonthOf returns a value between 1 and 12.

Note:        MonthOf returns the same value as the MonthOfTheYear function.
回复 支持 反对

使用道具 举报

发表于 2006-11-16 09:36:48 | 显示全部楼层
DayOfTheMonth

Returns the day of the month represented by a TDateTime value.

Unit

DateUtils

Category

date/time routines

function DayOfTheMonth(const AValue: TDateTime): Word;

Description

Call DayOfTheMonth to obtain the day of the month represented by a specified TDateTime value. DayOfTheMonth returns a value between 1 and 31.

Note:        DayOfTheMonth returns the same value as the DayOf function.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-16 09:55:31 | 显示全部楼层

谢谢!!!搞定

谢谢!!!搞定
回复 支持 反对

使用道具 举报

发表于 2007-12-14 11:28:26 | 显示全部楼层

收藏

varbinary
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-2 09:00 , Processed in 0.044364 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表