yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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() ) );
  *]
}