1
我有一个计算的字段,作为“参考号”通过合并日期和时间。但是,问题是时间格式,它显示上午/下午,我需要使它作为军事时间格式或24小时格式。有没有一个公式呢?我搜索了一些笔记本,但找不到任何东西。你可以帮我吗?这是我的代码:莲花笔记:公式:24小时时间格式显示
REM {Variable Assignment};
cType := RequestType;
cDate := @Text(@Created; "D0S0");
cTime := @Text(@Now; "T0S1");
REM {Get the list of synonyms from the svType view};
cView := "svKeywordType";
clist := @DbColumn("": ""; @DbName; cView; 2);
@If((@IsError(clist) | clist = ""); "There is no request type in this system."; clist);
REM {Get the request type description list};
cDesclist := @Left(clist; " | ");
REM {Get the request type synonym list};
cSynonymlist := @Right(clist; " | ");
REM {Check the position of the request type from the list};
cPos := @Member(cType; cDesclist);
REM {Given the position, get the request type description};
cSynonym := @Subset(@Subset(cSynonymlist; cPos); -1);
REM {Get the mm value};
cMonth := @Left(cDate; "/");
REM {Get the dd value};
cDay := @Left(@Right(cDate; "/"); "/");
REM {Get the yyyy value};
cYear := @Right(@Right(cDate; "/"); "/");
cHour := @Left(cTime; ":");
cMinute := @Left(@Right(cTime; ":"); ":");
cSecond := @Right(@Right(cTime; ":"); ":");
cdateToday := @Text(@Today; "D0S0");
ctimeToday := @Text(@Now; "T0S1");
cRef := cSynonym + "-" + cMonth + cDay + cYear + "-" + cHour + cMinute + cSecond;
@If(cType = "" | @IsError(cSynonym); ""; cRef)
编辑:顺便说一下,我使用的字段是文本。尝试使用日历并设置为24小时格式,但没有奏效。
感谢队友!很好的帮助! :) – drayl 2013-05-07 07:15:19
不客气:) – 2013-05-07 07:22:09