Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
VCL
Win 32 Controls
TAnimate
TComboBoxEx
TCoolBar
TDateTimePicker
THeaderControl
THotKey
TImageList
TListView
TMonthCalendar
TPageControl
TPageScroller
TProgressBar
TRichEdit
TStatusBar
TTabControl
TToolBar
TTrackBar
TTreeView
TUpDown
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/VCL/Win 32 Controls/TDateTimePicker
[ Add a report in this area ]
Report #:
47614
Status:
Open
TDateTimePicker Date property returns a time portion even though it is not documented to do so
Project:
Delphi
Build #:
11.0.2627.5503
Version:
11.0
Submitted By:
Eivind Bakkestuen
Report Type:
Minor failure / Design problem
Date Reported:
6/15/2007 6:15:30 PM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
252556
Resolution:
None
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
4
Description
The documentation of this property talks about setting *date*, it says nothing about a time portion. Since there is also a DateTime property, it is obvious that Date was supposed to return only the Date portiion.
If users rely on the docs, they will incorrectly assume that using Date will return a 0 time portion (ie midnight). This will for instance cause sql datasets to return wrong records if a datepicker.Date value is used to select a range of records.
It would seem that whoever created the TCommonCalendar.Date property get method forgot that a cast to TDate doesnt really do anything useful to the value. The function should remove the time portion too.
function TCommonCalendar.GetDate: TDate;
begin
Result := TDate(FDateTime);
end;
Steps to Reproduce:
Use TDateTimePicker.Date; observe the Time portion is whatever the hour of day happens to be when the function is called. This is not how one would expect a Date value to work.
Workarounds
using Trunc() on the returned value works around the problem.
Attachment
None
Comments
None
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us