Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
3rdRail
Blackfish SQL
C#Builder
C++BuilderX
CodeCentral
Conference
DBArtisan
Delphi for PHP
Delphi Prism
Delphi-BCB
EDN
InterBase
JBuilder
JBuilder 2007
Kylix
Optimizeit
QualityCentral
Test project
You are not logged in.
Help
Print
Public Report
Report From:
[ Add a report in this area ]
Report #:
30758
Status:
Closed
EncodeDate boundaries inconsistent with Win32
Project:
Build #:
42451
Version:
10.0
Submitted By:
Joe White
Report Type:
Basic functionality failure
Date Reported:
6/29/2006 7:30:13 AM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
257036
Resolution:
Feature Removed
(Resolution Comments)
Resolved in Build:
:
6.0.1.6
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
EncodeDate(1, 1, 1) is valid in Win32, but results in an exception in .NET. The Delphi/.NET EncodeDate, for no apparent reason, does not accept years prior to 100. (This despite the fact that TDateTime accepts them just fine.)
This means that there are valid values for TDateTime that cannot be returned from EncodeDate (for example, the *default* value of 1/1/0001 that you get if a variable is initialized to its default value). Round-tripping is a no-go.
Steps to Reproduce:
1. Write the following as a Win32 console app. Run it. No exception.
2. Run the same code as a .NET console app. Run it. Boom.
----
program Project3;
{$APPTYPE CONSOLE}
uses
SysUtils;
begin
EncodeDate(1, 1, 1);
end.
Workarounds
Use TDateTime.Create(1, 1, 1, 0, 0, 0, 0) instead of EncodeDate(1, 1, 1). (But if you want your code to compile in both Win32 and .NET, you're stuck with IFDEFs.)
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