Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/Date - Time    [ Add a report in this area ]  
Report #:  1557   Status: Reported
Faster way to get decoded Date/Time
Project:  Delphi Build #:
Version:    6.0 Submitted By:   Kristofer Skaug
Report Type:  Suggestion / Enhancement Request Date Reported:  6/18/2002 7:53:41 AM
Severity:    Commonly encountered problem Last Updated: 5/2/2003 12:58:35 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (11 Total Ratings)
3.55 out of 5
Total Votes: None
If you want to use a platform neutral way of obtaining the date/time decoded components (i.e.: year, month, day, hour, min, secs, msec) of the present instant (PC/system time), you would call DecodeTime(Time,Hour, Min, Sec, MSec);

But this is a shame for performance because the 'Time' function already uses EncodeTime(Hour, Min, Sec, MSec) to assemble the TDateTime value from individual  values obtained from the platform specific API call (Win32: GetLocalTime).

So my request is for a new set of platform-independent functions e.g.:

procedure QueryDecodedTime(var Hour, Min, Sec, MSec:word);
procedure QueryDecodedDate(var Year,Month,Day:word);

which bypass the big wobble inherent in DecodeTime(Time...) and give next-to-direct access to the API calls returning date and time in terms of component integer values.
Steps to Reproduce:

Kristofer Skaug at 1/17/2006 1:48:51 PM -
Still open for D2006 (almost 4 years later) - c'mon guys, how hard could this be? <g>

Pierre le Riche at 10/17/2006 1:34:31 PM -
I think the answer lies in the number of votes for this report ;-).

Server Response from: ETNACODE01