#502 closed enhancement (fixed)
PutDateFormat functions doesn't works
| Reported by: | jgarcia | Owned by: | danirus | 
|---|---|---|---|
| Priority: | highest | Milestone: | |
| Component: | TimeSetAlgebra | Version: | 1.1.5 | 
| Severity: | minor | Keywords: | |
| Cc: | 
Description
PutDateFormat function doesn't work as PutRealFormat.
An example:
Text old = PutDateFormat("%c%Y%m%d"); 
Text ""<< Copy(Now); 
Text  PutDateFormat(old); 
Text ""<< Copy(Now);
 Expected results:
"%c%Y%m%d"
20070803
"%c%Y%m%d"
"y2007m08d03h09i08s16.000"
 real results
"%c%Y%m%d"
"y2007m08d03h09i08s16.000"    <------------- WRONG !!!
"%c%Y%m%d"
"y2007m08d03h09i08s16.000"
Dani found yesterday what is wrong in this function; it's doing format date with a default format parameter without take in care format that user send to this function as argument.
Change History (3)
comment:1 Changed 18 years ago by
| Status: | new → assigned | 
|---|
comment:2 Changed 18 years ago by
| Resolution: | → fixed | 
|---|---|
| Status: | assigned → closed | 
comment:3 Changed 18 years ago by
Bug has been fixed in both TOL builds that are available at
v1.1.5 b.16 2007-08-27 17:19:50 i686-win
http://www.tol-project.org/pub/bin/win/tolbase-1.1.5-setup.exe
v1.1.6 b.0.19.alpha 2007-08-27 17:38:11 i686-win
http://www.tol-project.org/pub/bin/win/tolbase-1.1.6-setup.exe


Name() method from BDate class [1] didn't use the defect_ attribute of BDateFormat. This attribute keeps the default formatting pattern for Dates.
I've fixed method Name() in dtealgeb.cpp.
Thanks for your bug report, cheers
Daniel
footnotes:
[1] -> http://www.tol-project.org/tolapi/classBDate.html#a15