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

◆ ToChars() [3/9]

static int System.Xml.XmlConverter.ToChars ( DateTime value,
byte[] chars,
int offset )
inlinestatic

Definition at line 1209 of file XmlConverter.cs.

1210 {
1211 int num = offset;
1212 offset += ToCharsD4(value.Year, chars, offset);
1213 chars[offset++] = 45;
1214 offset += ToCharsD2(value.Month, chars, offset);
1215 chars[offset++] = 45;
1216 offset += ToCharsD2(value.Day, chars, offset);
1217 chars[offset++] = 84;
1218 offset += ToCharsD2(value.Hour, chars, offset);
1219 chars[offset++] = 58;
1220 offset += ToCharsD2(value.Minute, chars, offset);
1221 chars[offset++] = 58;
1222 offset += ToCharsD2(value.Second, chars, offset);
1223 int num2 = (int)(value.Ticks % 10000000);
1224 if (num2 != 0)
1225 {
1226 chars[offset++] = 46;
1228 }
1229 switch (value.Kind)
1230 {
1231 case DateTimeKind.Local:
1232 {
1233 TimeSpan utcOffset = TimeZoneInfo.Local.GetUtcOffset(value);
1234 if (utcOffset.Ticks < 0)
1235 {
1236 chars[offset++] = 45;
1237 }
1238 else
1239 {
1240 chars[offset++] = 43;
1241 }
1242 offset += ToCharsD2(Math.Abs(utcOffset.Hours), chars, offset);
1243 chars[offset++] = 58;
1244 offset += ToCharsD2(Math.Abs(utcOffset.Minutes), chars, offset);
1245 break;
1246 }
1247 case DateTimeKind.Utc:
1248 chars[offset++] = 90;
1249 break;
1250 default:
1252 case DateTimeKind.Unspecified:
1253 break;
1254 }
1255 return offset - num;
1256 }
static int ToCharsD4(int value, byte[] chars, int offset)
static int ToCharsD7(int value, byte[] chars, int offset)
static int ToCharsD2(int value, byte[] chars, int offset)

References System.Math.Abs(), System.chars, System.Xml.Dictionary, System.TimeZoneInfo.Local, System.offset, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.Xml.XmlConverter.ToCharsD2(), System.Xml.XmlConverter.ToCharsD4(), System.Xml.XmlConverter.ToCharsD7(), and System.value.