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

◆ ParseTimeZoneOffset()

static bool System.DateTimeParse.ParseTimeZoneOffset ( ref __DTString str,
int len,
ref TimeSpan result )
inlinestaticprivate

Definition at line 2786 of file DateTimeParse.cs.

2787 {
2788 bool result2 = true;
2789 int result3 = 0;
2790 int result4;
2791 if ((uint)(len - 1) <= 1u)
2792 {
2793 if (!ParseSign(ref str, ref result2))
2794 {
2795 return false;
2796 }
2797 if (!ParseDigits(ref str, len, out result4))
2798 {
2799 return false;
2800 }
2801 }
2802 else
2803 {
2804 if (!ParseSign(ref str, ref result2))
2805 {
2806 return false;
2807 }
2808 if (!ParseDigits(ref str, 1, out result4))
2809 {
2810 return false;
2811 }
2812 if (str.Match(":"))
2813 {
2814 if (!ParseDigits(ref str, 2, out result3))
2815 {
2816 return false;
2817 }
2818 }
2819 else
2820 {
2821 str.Index--;
2822 if (!ParseDigits(ref str, 2, out result3))
2823 {
2824 return false;
2825 }
2826 }
2827 }
2828 if (result3 < 0 || result3 >= 60)
2829 {
2830 return false;
2831 }
2832 result = new TimeSpan(result4, result3, 0);
2833 if (!result2)
2834 {
2835 result = result.Negate();
2836 }
2837 return true;
2838 }
static bool ParseDigits(ref __DTString str, int digitLen, out int result)
static bool ParseSign(ref __DTString str, ref bool result)

References System.len, System.DateTimeParse.ParseDigits(), System.DateTimeParse.ParseSign(), and System.str.

Referenced by System.DateTimeParse.ParseByFormat().