MantisBT - Soldat Dedicated Server
View Issue Details
0000401Soldat Dedicated ServerScripting Corepublic2013-08-26 08:002014-10-08 23:25
Mighty 
ExHunter 
lowtweakalways
resolvedfixed 
x86-64Mac OS X10.4
2.7.5 
 
0000401: SCv3 - StrToDate doesn't work as intended
Function takes a string as an argument, but as if it started from index 2, e.g. "2013-08-26" will be passed as "013-08-26". However, " 2013-08-26" is not a valid input as well.

This causes StrToDate( DateToStr( Now ) ) to not work.
Every single one below causes an error.

StrToDate(DateToStr(Date()));
StrToDate(' 2013-08-26');
StrToDate(' 13/08/10');
StrToDate(' 15/03/75');
StrToDate(' 15-03-75');
I failed in finding the working function input
No tags attached.
Issue History
2013-08-26 08:00MightyNew Issue
2013-09-09 15:45FalconStatusnew => acknowledged
2014-09-07 00:27ExHunterNote Added: 0002293
2014-09-07 00:27ExHunterAssigned To => ExHunter
2014-09-07 00:27ExHunterStatusacknowledged => assigned
2014-09-07 01:34ExHunterNote Added: 0002294
2014-09-07 01:34ExHunterStatusassigned => feedback
2014-09-07 01:34ExHunterNote Edited: 0002294bug_revision_view_page.php?bugnote_id=2294#r558
2014-09-07 01:38ExHunterNote Edited: 0002294bug_revision_view_page.php?bugnote_id=2294#r559
2014-10-04 12:40MightyNote Added: 0002316
2014-10-04 12:40MightyStatusfeedback => assigned
2014-10-04 22:33ExHunterNote Added: 0002317
2014-10-08 23:25ExHunterNote Added: 0002326
2014-10-08 23:25ExHunterStatusassigned => resolved
2014-10-08 23:25ExHunterResolutionopen => fixed

Notes
(0002293)
ExHunter   
2014-09-07 00:27   
related to this

http://stackoverflow.com/questions/1713526/pascal-string-to-date [^]

trying to figure out how to include those 2 variables nicely into ScriptCore3.
(0002294)
ExHunter   
2014-09-07 01:34   
(edited on: 2014-09-07 01:38)
Please provide feedback in the upcoming 1.6.8 beta.

Use the new stuff:

Global.ShortDateFormat := 'd/m/y';
Global.DateSeparator := '/';

before any execution of StrToDate (once is okay tho).

(0002316)
Mighty   
2014-10-04 12:40   
Issues listed before are all still present despite setting the Global properties.
(0002317)
ExHunter   
2014-10-04 22:33   
look,

try this:

Global.DateSeparator := '-';
WriteLn(DateToStr(StrToDate('15-03-75')));

for me it works. Please note that DateSeparator needs to be the same char as the separator used in your string.
(0002326)
ExHunter   
2014-10-08 23:25   
Well, closing this now (setting this to resolved)

use StrToDateTime instead in the next version.