Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ MatchTimeMark()

static bool System.DateTimeParse.MatchTimeMark ( ref __DTString str,
DateTimeFormatInfo dtfi,
ref TM result )
inlinestaticprivate

Definition at line 3003 of file DateTimeParse.cs.

3004 {
3005 result = TM.NotSet;
3006 if (dtfi.AMDesignator.Length == 0)
3007 {
3008 result = TM.AM;
3009 }
3010 if (dtfi.PMDesignator.Length == 0)
3011 {
3012 result = TM.PM;
3013 }
3014 if (str.GetNext())
3015 {
3016 string aMDesignator = dtfi.AMDesignator;
3017 if (aMDesignator.Length > 0 && str.MatchSpecifiedWord(aMDesignator))
3018 {
3019 str.Index += aMDesignator.Length - 1;
3020 result = TM.AM;
3021 return true;
3022 }
3023 aMDesignator = dtfi.PMDesignator;
3024 if (aMDesignator.Length > 0 && str.MatchSpecifiedWord(aMDesignator))
3025 {
3026 str.Index += aMDesignator.Length - 1;
3027 result = TM.PM;
3028 return true;
3029 }
3030 str.Index--;
3031 }
3032 if (result != TM.NotSet)
3033 {
3034 return true;
3035 }
3036 return false;
3037 }

References System.Globalization.DateTimeFormatInfo.AMDesignator, System.Globalization.DateTimeFormatInfo.PMDesignator, and System.str.

Referenced by System.DateTimeParse.ParseByFormat().