BCB in Time

xiaoxiao2021-03-06  15

1.Time_t to TM Convert STRUCTTM * LOCALTIME (const time_t * Timer);

2.TM to TIME_T conversion TIME_T MKTIME (StructTM * T);

3.TM to TDATETIME

TDATETIME DA, TM, DT; TM * TMS;

DA = Encodedate (Word) TMS-> TM_YEAR, (WORD) TMS-> TM_MDAY); TM = Encodetime ((Word) TMS-> TM_HOUR, (WORD) TMS-> TM_MIN, Word) TMS-> TM_SEC, 0);

DT = da.val tm.val;

4.Struct TM * localtime (const time_t * timer) Convert Time_t Time (GMT) to local TM time

5.Time (Time_t *) Get the current GMT Time_t time of the system

Note: Time_t to tdatetime's conversion path is: Time_t -------> [LocalTime ()] TM ------> [Encodedate, Encodetime] TDATETIME

TDATETIME to TIME_T conversion path is: tdatetime ---------> [decodedate (), decodetime ()] tm -------> [mktime ()] Time_t

转载请注明原文地址:https://www.9cbs.com/read-46668.html

New Post(0)