陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Quintiq file version 2.0
#parent: #root
StaticMethod Convert3DSpaceStringToDate (
  String dateAsString_i
) as Date
{
  Description: 'Convert a String in the 3DSpace Date- or DateTime-format to a Date.'
  TextBody:
  [*
    // Create a DateConverter that uses the expected format.
    mask := LibDIF_Util::DATE_FORMAT_3DSPACE();
    
    converter := StringToDate::StandardConverter();
    converter.SetCustomConversion();
    converter.CustomFormatString( mask );
    
    // Only using the length of the mask makes it possible to also convert a DateTime into a Date.
    return converter.Convert( dateAsString_i.SubString( 0, mask.Length() ) );
  *]
}