如何获得当前时间？

yiyepianzhou 2004-04-29 08:12:39

－－在下刚刚接触CB，请高手指点，呵呵，当然，这是很简单的问题，也许只要一两条语句：）
...全文
192 8 点赞 打赏 收藏 举报

8 条回复

yiyepianzhou 2004-05-04

• 打赏
• 举报

heguxun 2004-04-30

• 打赏
• 举报

zthhyt 2004-04-30
Now()
• 打赏
• 举报

BreakeSky 2004-04-30

• 打赏
• 举报

chpst 2004-04-30

AnsiString str = Now().FormatString("yyyy-mm-dd hh:nn:ss");
• 打赏
• 举报

hbgdyxh 2004-04-29
AnsiString time = TimeToStr(Time());

double time1 = Time() + 1,time2 = Time();
double subtime = time1 - time2;//subtime的单位是天
subtime = subtime * 24; //得到小时
Edit1->Text = FloatToStr(subtime);

subtime = subtime * 60; //得到分钟
Edit2->Text = FloatToStr(subtime);

• 打赏
• 举报

COKING 2004-04-29
Date().DateString();
• 打赏
• 举报

JetKingLau 2004-04-29

AnsiString str = Now().FormatString("yyyy-mm-dd hh:nn:ss");

TDateTime time1 = ?
TDateTime time2 = ?

int years = YearsBetween(time1, time2);
int mons = MonthsBetween(time1, time2);
int days = DaysBetween(time1, time2);
int hours = HoursBetween(time1, time2);
int mins = MinutesBetween(time1, time2);
int secs = SecondsBetween(time1, time2);
int msecs = MilliSecondsBetween(time1, time2);
• 打赏
• 举报

1.3w+

C++ Builder相关内容讨论区

2004-04-29 08:12