262 references to DateTimeKind
mscorlib (122)
system\currenttimezone.cs (8)
143
if (time.Kind ==
DateTimeKind
.Local) {
150
return new DateTime(DateTime.MaxTicks,
DateTimeKind
.Local);
153
return new DateTime(DateTime.MinTicks,
DateTimeKind
.Local);
155
return new DateTime(tick,
DateTimeKind
.Local, isAmbiguousLocalDst);
235
if (time.Kind ==
DateTimeKind
.Utc) {
260
hour, minute, second, millisecond,
DateTimeKind
.Local);
267
time = new DateTime(year, month, 1, hour, minute, second, millisecond,
DateTimeKind
.Local);
284
time = new DateTime(year, month, cal.GetDaysInMonth(year, month), hour, minute, second, millisecond,
DateTimeKind
.Local);
system\datetime.cs (45)
116
public static readonly DateTime MinValue = new DateTime(MinTicks,
DateTimeKind
.Unspecified);
117
public static readonly DateTime MaxValue = new DateTime(MaxTicks,
DateTimeKind
.Unspecified);
157
public DateTime(long ticks,
DateTimeKind
kind) {
161
if (kind <
DateTimeKind
.Unspecified || kind >
DateTimeKind
.Local) {
168
internal DateTime(long ticks,
DateTimeKind
kind, Boolean isAmbiguousDst) {
172
Contract.Requires(kind ==
DateTimeKind
.Local, "Internal Constructor is for local times only");
196
if (second == 60 && s_isLeapSecondsSupportedSystem && IsValidTimeWithLeapSeconds(year, month, day, hour, minute, second,
DateTimeKind
.Unspecified))
207
public DateTime(int year, int month, int day, int hour, int minute, int second,
DateTimeKind
kind) {
208
if (kind <
DateTimeKind
.Unspecified || kind >
DateTimeKind
.Local) {
246
if (!IsValidTimeWithLeapSeconds(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, 60,
DateTimeKind
.Unspecified))
262
if (second == 60 && s_isLeapSecondsSupportedSystem && IsValidTimeWithLeapSeconds(year, month, day, hour, minute, second,
DateTimeKind
.Unspecified))
278
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond,
DateTimeKind
kind) {
282
if (kind <
DateTimeKind
.Unspecified || kind >
DateTimeKind
.Local) {
330
if (!IsValidTimeWithLeapSeconds(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, 60,
DateTimeKind
.Unspecified))
337
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar,
DateTimeKind
kind) {
343
if (kind <
DateTimeKind
.Unspecified || kind >
DateTimeKind
.Local) {
724
DateTime utcDt = new DateTime(ticks,
DateTimeKind
.Utc);
737
return new DateTime(ticks,
DateTimeKind
.Local, isAmbiguousLocalDst);
774
return new DateTime(universalTicks,
DateTimeKind
.Utc);
780
return new DateTime(DoubleDateToTicks(d),
DateTimeKind
.Unspecified);
798
if (Kind ==
DateTimeKind
.Utc) {
804
public static DateTime SpecifyKind(DateTime value,
DateTimeKind
kind) {
809
if (Kind ==
DateTimeKind
.Local) {
1000
public
DateTimeKind
Kind {
1004
return
DateTimeKind
.Unspecified;
1006
return
DateTimeKind
.Utc;
1008
return
DateTimeKind
.Local;
1053
Contract.Ensures(Contract.Result<DateTime>().Kind ==
DateTimeKind
.Local);
1060
return new DateTime(DateTime.MaxTicks,
DateTimeKind
.Local);
1063
return new DateTime(DateTime.MinTicks,
DateTimeKind
.Local);
1065
return new DateTime(tick,
DateTimeKind
.Local, isAmbiguousLocalDst);
1072
Contract.Ensures(Contract.Result<DateTime>().Kind ==
DateTimeKind
.Utc);
1214
internal static bool IsValidTimeWithLeapSeconds(int year, int month, int day, int hour, int minute, int second,
DateTimeKind
kind)
1221
case
DateTimeKind
.Local: return ValidateSystemTime(ref time, localTime: true);
1222
case
DateTimeKind
.Utc: return ValidateSystemTime(ref time, localTime: false);
1398
if (Kind ==
DateTimeKind
.Local) {
1410
return new DateTime(DateTime.MaxTicks,
DateTimeKind
.Local);
1417
return new DateTime(DateTime.MinTicks,
DateTimeKind
.Local);
1419
return new DateTime(tick,
DateTimeKind
.Local, isAmbiguousLocalDst);
1675
if (s_isLeapSecondsSupportedSystem && IsValidTimeWithLeapSeconds(year, month, day, hour, minute, second,
DateTimeKind
.Unspecified))
1696
result = new DateTime(ticks,
DateTimeKind
.Unspecified);
system\datetimeoffset.cs (11)
71
if (dateTime.Kind !=
DateTimeKind
.Utc) {
86
if (dateTime.Kind ==
DateTimeKind
.Local) {
91
else if (dateTime.Kind ==
DateTimeKind
.Utc) {
114
!DateTime.IsValidTimeWithLeapSeconds(m_dateTime.Year, m_dateTime.Month, m_dateTime.Day, m_dateTime.Hour, m_dateTime.Minute, 60,
DateTimeKind
.Utc))
135
!DateTime.IsValidTimeWithLeapSeconds(m_dateTime.Year, m_dateTime.Month, m_dateTime.Day, m_dateTime.Hour, m_dateTime.Minute, 60,
DateTimeKind
.Utc))
157
!DateTime.IsValidTimeWithLeapSeconds(m_dateTime.Year, m_dateTime.Month, m_dateTime.Day, m_dateTime.Hour, m_dateTime.Minute, 60,
DateTimeKind
.Utc))
190
Contract.Ensures(Contract.Result<DateTime>().Kind ==
DateTimeKind
.Utc);
191
return DateTime.SpecifyKind(m_dateTime,
DateTimeKind
.Utc);
198
Contract.Ensures(Contract.Result<DateTime>().Kind ==
DateTimeKind
.Local);
217
return new DateTime((m_dateTime + Offset).Ticks,
DateTimeKind
.Unspecified);
807
return new DateTime(utcTicks,
DateTimeKind
.Unspecified);
system\globalization\datetimeformat.cs (5)
727
} else if (dateTime.Kind ==
DateTimeKind
.Utc) {
737
dateTime = DateTime.SpecifyKind(dateTime,
DateTimeKind
.Local);
777
case
DateTimeKind
.Local:
782
case
DateTimeKind
.Utc:
881
else if (dateTime.Kind ==
DateTimeKind
.Local) {
system\globalization\datetimeparse.cs (9)
2594
result.parsedDate = DateTime.SpecifyKind(result.parsedDate,
DateTimeKind
.Local);
2600
result.parsedDate = DateTime.SpecifyKind(result.parsedDate,
DateTimeKind
.Utc);
2610
Contract.Assert(result.parsedDate.Kind ==
DateTimeKind
.Unspecified, "result.parsedDate.Kind == DateTimeKind.Unspecified");
2616
result.parsedDate = DateTime.SpecifyKind(result.parsedDate,
DateTimeKind
.Utc);
2673
result.parsedDate = new DateTime(utcTicks,
DateTimeKind
.Utc);
2698
result.parsedDate = new DateTime(resultTicks,
DateTimeKind
.Utc);
2736
DateTime utcDt = new DateTime(resultTicks,
DateTimeKind
.Utc);
2746
result.parsedDate = new DateTime(resultTicks,
DateTimeKind
.Local, isAmbiguousLocalDst);
3348
return new DateTime(DateTime.UtcNow.Ticks + result.timeZoneOffset.Ticks,
DateTimeKind
.Unspecified);
system\timezone.cs (8)
96
if (time.Kind ==
DateTimeKind
.Utc) {
101
return new DateTime(DateTime.MaxTicks,
DateTimeKind
.Utc);
104
return new DateTime(DateTime.MinTicks,
DateTimeKind
.Utc);
106
return new DateTime(tickCount,
DateTimeKind
.Utc);
113
if (time.Kind ==
DateTimeKind
.Local) {
118
return new DateTime(time.Ticks + offset,
DateTimeKind
.Local, isAmbiguousLocalDst);
200
DateTimeKind
kind = time.Kind;
201
if (kind ==
DateTimeKind
.Utc) {
system\timezoneinfo.cs (36)
189
public
DateTimeKind
GetCorrespondingKind(TimeZoneInfo timeZone) {
190
DateTimeKind
kind;
212
kind =
DateTimeKind
.Utc;
215
kind =
DateTimeKind
.Local;
218
kind =
DateTimeKind
.Unspecified;
383
if (dateTime.Kind ==
DateTimeKind
.Local) {
387
else if (dateTime.Kind ==
DateTimeKind
.Utc) {
448
if (dateTime.Kind ==
DateTimeKind
.Local) {
449
if (cachedData.GetCorrespondingKind(this) !=
DateTimeKind
.Local) {
472
else if (dateTime.Kind ==
DateTimeKind
.Utc) {
473
if (cachedData.GetCorrespondingKind(this) ==
DateTimeKind
.Utc) {
514
if (dateTime.Kind ==
DateTimeKind
.Local) {
518
else if (dateTime.Kind ==
DateTimeKind
.Utc) {
579
if (dateTime.Kind ==
DateTimeKind
.Local) {
582
else if (dateTime.Kind ==
DateTimeKind
.Utc) {
583
if (cachedData.GetCorrespondingKind(this) ==
DateTimeKind
.Utc) {
623
if ( (dateTime.Kind ==
DateTimeKind
.Unspecified)
624
|| (dateTime.Kind ==
DateTimeKind
.Local && s_cachedData.GetCorrespondingKind(this) ==
DateTimeKind
.Local) ) {
672
if (dateTime.Kind ==
DateTimeKind
.Local && String.Compare(sourceTimeZoneId, TimeZoneInfo.Local.Id, StringComparison.OrdinalIgnoreCase) == 0) {
681
else if (dateTime.Kind ==
DateTimeKind
.Utc && String.Compare(sourceTimeZoneId, TimeZoneInfo.Utc.Id, StringComparison.OrdinalIgnoreCase) == 0) {
738
if (dateTime.Kind ==
DateTimeKind
.Utc) {
765
DateTimeKind
sourceKind = cachedData.GetCorrespondingKind(sourceTimeZone);
766
if ( ((flags & TimeZoneInfoOptions.NoThrowOnInvalidTime) == 0) && (dateTime.Kind !=
DateTimeKind
.Unspecified) && (dateTime.Kind != sourceKind) ) {
799
DateTimeKind
targetKind = cachedData.GetCorrespondingKind(destinationTimeZone);
802
if (dateTime.Kind !=
DateTimeKind
.Unspecified && sourceKind !=
DateTimeKind
.Unspecified
813
if (targetKind ==
DateTimeKind
.Local) {
816
return new DateTime(targetConverted.Ticks,
DateTimeKind
.Local, isAmbiguousLocalDst);
843
if (dateTime.Kind ==
DateTimeKind
.Utc) {
852
if (dateTime.Kind ==
DateTimeKind
.Utc) {
1486
if (time.Kind ==
DateTimeKind
.Local) {
1519
if (isDst && time.Kind ==
DateTimeKind
.Local) {
3163
if (dateStart.Kind !=
DateTimeKind
.Unspecified) {
3167
if (dateEnd.Kind !=
DateTimeKind
.Unspecified) {
3434
if (timeOfDay.Kind !=
DateTimeKind
.Unspecified) {
System (5)
net\System\Net\mail\SmtpDateTime.cs (5)
129
case
DateTimeKind
.Local:
135
case
DateTimeKind
.Unspecified:
139
case
DateTimeKind
.Utc:
167
return DateTime.SpecifyKind(this.date,
DateTimeKind
.Unspecified);
331
Debug.Assert(dateValue.Kind ==
DateTimeKind
.Unspecified);
System.Activities (1)
System\Activities\Expressions\Literal.cs (1)
111
if (literalValue.Second == 0 && literalValue.Millisecond == 0 && literalValue.Kind ==
DateTimeKind
.Unspecified)
System.Data (16)
fx\src\data\System\Data\Common\DateTimeStorage.cs (8)
145
if (tmpValue.Kind ==
DateTimeKind
.Utc) {
148
else if (tmpValue.Kind ==
DateTimeKind
.Local) {
152
retVal = DateTime.SpecifyKind(tmpValue,
DateTimeKind
.Utc);
156
if (tmpValue.Kind ==
DateTimeKind
.Local) {
159
else if (tmpValue.Kind ==
DateTimeKind
.Utc) {
163
retVal = DateTime.SpecifyKind(tmpValue,
DateTimeKind
.Local);
168
retVal = DateTime.SpecifyKind(tmpValue,
DateTimeKind
.Unspecified);
231
values[i] = DateTime.SpecifyKind(values[i].ToLocalTime(),
DateTimeKind
.Unspecified); //Strip the kind for UnspecifiedLocal.
fx\src\data\System\Data\Common\ObjectStorage.cs (4)
432
if (dt.Kind ==
DateTimeKind
.Local) {
433
typedStore[storeIndex] = DateTime.SpecifyKind(dt.ToUniversalTime(),
DateTimeKind
.Local);
443
if (dt.Kind ==
DateTimeKind
.Local) {
444
values[i] = (DateTime.SpecifyKind(dt,
DateTimeKind
.Utc)).ToLocalTime();
fx\src\data\System\Data\Filter\FunctionNode.cs (3)
458
case
DateTimeKind
.Utc:
463
case
DateTimeKind
.Local:
468
case
DateTimeKind
.Unspecified: break;
fx\src\data\System\Data\SQLTypes\SQLDateTime.cs (1)
638
if (dt.Kind != System.
DateTimeKind
.Unspecified)
System.Data.Entity.Design (2)
System\Data\EntityModel\Emitters\PropertyEmitter.cs (2)
769
DateTime dateTime = DateTime.SpecifyKind(utc,
DateTimeKind
.Unspecified);
771
return new CodeObjectCreateExpression(TypeReference.DateTime, new CodePrimitiveExpression(dateTime.Ticks), GetEnumValue(
DateTimeKind
.Unspecified));
System.Data.Services (7)
System\Data\Services\Serializers\JsonReader.cs (1)
93
DateTime dateTime = new DateTime(ticks * 10000 + JsonWriter.DatetimeMinTimeTicks,
DateTimeKind
.Utc);
System\Data\Services\Serializers\JsonWriter.cs (6)
28
internal static readonly long DatetimeMinTimeTicks = (new DateTime(1970, 1, 1, 0, 0, 0,
DateTimeKind
.Utc)).Ticks;
268
case
DateTimeKind
.Local:
271
case
DateTimeKind
.Unspecified:
272
dateTime = new DateTime(dateTime.Ticks,
DateTimeKind
.Utc);
274
case
DateTimeKind
.Utc:
278
System.Diagnostics.Debug.Assert(dateTime.Kind ==
DateTimeKind
.Utc, "dateTime.Kind == DateTimeKind.Utc");
System.Data.Services.Client (2)
System\Data\Services\Client\ClientConvert.cs (2)
317
return XmlConvert.ToString(dt.Kind ==
DateTimeKind
.Unspecified && atomDateConstruct ? new DateTime(dt.Ticks,
DateTimeKind
.Utc) : dt, XmlDateTimeSerializationMode.RoundtripKind);
System.Data.Services.Design (2)
System\Data\EntityModel\Emitters\PropertyEmitter.cs (2)
703
DateTime dateTime = DateTime.SpecifyKind(utc,
DateTimeKind
.Unspecified);
705
return new CodeObjectCreateExpression(TypeReference.DateTime, new CodePrimitiveExpression(dateTime.Ticks), GetEnumValue(
DateTimeKind
.Unspecified));
System.IdentityModel (15)
System\IdentityModel\BoundedCache.cs (1)
376
if (expirationTime.Kind !=
DateTimeKind
.Utc)
System\IdentityModel\DateTimeUtil.cs (4)
52
public static DateTime GetMaxValue(
DateTimeKind
kind)
57
public static DateTime GetMinValue(
DateTimeKind
kind)
64
if (null == value || value.Value.Kind ==
DateTimeKind
.Utc)
74
if (value.Kind ==
DateTimeKind
.Utc)
System\IdentityModel\SecurityUtils.cs (2)
56
return new DateTime(DateTime.MaxValue.Ticks - TimeSpan.TicksPerDay,
DateTimeKind
.Utc);
65
return new DateTime(DateTime.MinValue.Ticks + TimeSpan.TicksPerDay,
DateTimeKind
.Utc);
System\IdentityModel\Tokens\SamlSecurityTokenHandler.cs (4)
48
static DateTime WCFMinValue = new DateTime(DateTime.MinValue.Ticks + TimeSpan.TicksPerDay,
DateTimeKind
.Utc);
49
static DateTime WCFMaxValue = new DateTime(DateTime.MaxValue.Ticks - TimeSpan.TicksPerDay,
DateTimeKind
.Utc);
1983
if (conditions.NotBefore != DateTimeUtil.GetMinValue(
DateTimeKind
.Utc) &&
1992
if (conditions.NotOnOrAfter != DateTimeUtil.GetMaxValue(
DateTimeKind
.Utc) &&
System\IdentityModel\Tokens\SessionSecurityToken.cs (4)
465
DateTime effectiveTime = new DateTime(XmlUtil.ReadElementContentAsInt64(reader),
DateTimeKind
.Utc);
471
DateTime expiryTime = new DateTime(XmlUtil.ReadElementContentAsInt64(reader),
DateTimeKind
.Utc);
477
DateTime keyEffectiveTime = new DateTime(XmlUtil.ReadElementContentAsInt64(reader),
DateTimeKind
.Utc);
483
DateTime keyExpiryTime = new DateTime(XmlUtil.ReadElementContentAsInt64(reader),
DateTimeKind
.Utc);
System.Runtime.Caching (1)
System\Caching\MemoryCacheEntryChangeMonitor.cs (1)
15
private static readonly DateTime DATETIME_MINVALUE_UTC = new DateTime(0,
DateTimeKind
.Utc);
System.Runtime.Serialization (21)
System\Runtime\Serialization\DateTimeOffsetAdapter.cs (1)
47
case
DateTimeKind
.Unspecified:
System\Runtime\Serialization\Json\JsonGlobals.cs (1)
36
public static readonly long unixEpochTicks = new DateTime(1970, 1, 1, 0, 0, 0,
DateTimeKind
.Utc).Ticks;
System\Runtime\Serialization\Json\JsonReaderDelegator.cs (8)
198
DateTimeKind
dateTimeKind =
DateTimeKind
.Utc;
208
dateTimeKind =
DateTimeKind
.Local;
234
DateTime dateTime = new DateTime(ticks,
DateTimeKind
.Utc);
237
case
DateTimeKind
.Local:
239
case
DateTimeKind
.Unspecified:
240
return DateTime.SpecifyKind(dateTime.ToLocalTime(),
DateTimeKind
.Unspecified);
241
case
DateTimeKind
.Utc:
System\Runtime\Serialization\Json\JsonWriterDelegator.cs (4)
203
if (value.Kind !=
DateTimeKind
.Utc)
226
case
DateTimeKind
.Unspecified:
227
case
DateTimeKind
.Local:
251
case
DateTimeKind
.Utc:
System\Xml\XmlConverter.cs (7)
756
DateTimeKind
kind =
DateTimeKind
.Unspecified;
790
kind =
DateTimeKind
.Utc;
797
kind =
DateTimeKind
.Utc;
1101
case
DateTimeKind
.Unspecified:
1103
case
DateTimeKind
.Local:
1114
case
DateTimeKind
.Utc:
System.ServiceModel (12)
System\ServiceModel\Dispatcher\XPathMessageContext.cs (2)
204
internal readonly static DateTime ZeroDate = new DateTime(1, 1, 1, 0, 0, 0,
DateTimeKind
.Utc);
416
if (date.Kind !=
DateTimeKind
.Utc)
System\ServiceModel\Security\SecurityTimestamp.cs (2)
32
Fx.Assert(creationTimeUtc.Kind ==
DateTimeKind
.Utc, "creation time must be in UTC");
33
Fx.Assert(expiryTimeUtc.Kind ==
DateTimeKind
.Utc, "expiry time must be in UTC");
System\ServiceModel\Security\SecurityUtils.cs (2)
374
return new DateTime(DateTime.MaxValue.Ticks - TimeSpan.TicksPerDay,
DateTimeKind
.Utc);
383
return new DateTime(DateTime.MinValue.Ticks + TimeSpan.TicksPerDay,
DateTimeKind
.Utc);
System\ServiceModel\Security\TimeBoundedCache.cs (2)
348
Fx.Assert(item.ExpirationTime == DateTime.MaxValue || item.ExpirationTime.Kind ==
DateTimeKind
.Utc, "");
504
Fx.Assert( expirationTime == DateTime.MaxValue || expirationTime.Kind ==
DateTimeKind
.Utc, "");
System\ServiceModel\Security\Tokens\SecurityContextCookieSerializer.cs (4)
70
effectiveTime = new DateTime(XmlHelper.ReadElementContentAsInt64(reader),
DateTimeKind
.Utc);
74
expiryTime = new DateTime(XmlHelper.ReadElementContentAsInt64(reader),
DateTimeKind
.Utc);
86
keyEffectiveTime = new DateTime(XmlHelper.ReadElementContentAsInt64(reader),
DateTimeKind
.Utc);
90
keyExpirationTime = new DateTime(XmlHelper.ReadElementContentAsInt64(reader),
DateTimeKind
.Utc);
System.ServiceModel.Web (5)
System\ServiceModel\Description\WebScriptClientGenerator.cs (1)
38
this.serviceLastModified = new DateTime(this.serviceLastModified.Year, this.serviceLastModified.Month, this.serviceLastModified.Day, this.serviceLastModified.Hour, this.serviceLastModified.Minute, this.serviceLastModified.Second,
DateTimeKind
.Utc);
System\ServiceModel\Dispatcher\HelpExampleGenerator.cs (3)
513
case
DateTimeKind
.Unspecified:
514
case
DateTimeKind
.Local:
529
case
DateTimeKind
.Utc:
System\ServiceModel\Web\OutgoingWebResponseContext.cs (1)
73
(value.Kind ==
DateTimeKind
.Utc ?
System.Web (18)
Profile\ProfileInfo.cs (2)
37
if (lastActivityDate.Kind ==
DateTimeKind
.Local) {
41
if (lastUpdatedDate.Kind ==
DateTimeKind
.Local) {
Profile\SqlProfileProvider.cs (2)
527
dtLastActivity = DateTime.SpecifyKind(reader.GetDateTime(2),
DateTimeKind
.Utc);
528
dtLastUpdated = DateTime.SpecifyKind(reader.GetDateTime(3),
DateTimeKind
.Utc);
Security\ADMembershipProvider.cs (1)
116
private readonly DateTime DefaultLastLockoutDate = new DateTime(1754, 1, 1, 0, 0, 0,
DateTimeKind
.Utc);
Security\FormsAuthenticationTicketSerializer.cs (2)
69
DateTime ticketIssueDateUtc = new DateTime(ticketIssueDateUtcTicks,
DateTimeKind
.Utc);
82
DateTime ticketExpirationDateUtc = new DateTime(ticketExpirationDateUtcTicks,
DateTimeKind
.Utc);
Security\SQLMembershipProvider.cs (1)
1895
return new DateTime(utcDateTime.Year, utcDateTime.Month, utcDateTime.Day, utcDateTime.Hour, utcDateTime.Minute, utcDateTime.Second,
DateTimeKind
.Utc);
StaticFileHandler.cs (2)
519
DateTimeKind
.Utc);
528
lastModifiedInUtc = new DateTime(utcNow.Ticks - (utcNow.Ticks % TimeSpan.TicksPerSecond),
DateTimeKind
.Utc);
UI\WebParts\SqlPersonalizationProvider.cs (3)
121
DateTime.SpecifyKind(reader.GetDateTime(1),
DateTimeKind
.Utc);
245
DateTime lastUpdatedDate = DateTime.SpecifyKind(reader.GetDateTime(1),
DateTimeKind
.Utc);
248
DateTime lastActivityDate = DateTime.SpecifyKind(reader.GetDateTime(4),
DateTimeKind
.Utc);
Util\DateTimeUtil.cs (1)
31
return new DateTime(universalTicks,
DateTimeKind
.Utc);
Util\FileUtil.cs (3)
596
UtcCreationTime = new DateTime(0,
DateTimeKind
.Utc);
597
UtcLastAccessTime = new DateTime(0,
DateTimeKind
.Utc);
598
UtcLastWriteTime = new DateTime(0,
DateTimeKind
.Utc);
Util\ParseHttpDate.cs (1)
219
return new DateTime(year, month, day, hour, minute, second,
DateTimeKind
.Utc);
System.Web.Extensions (2)
Script\Serialization\JavaScriptObjectDeserializer.cs (1)
380
DateTime dt = new DateTime(ticks * 10000 + JavaScriptSerializer.DatetimeMinTimeTicks,
DateTimeKind
.Utc);
Script\Serialization\JavaScriptSerializer.cs (1)
211
internal static readonly long DatetimeMinTimeTicks = (new DateTime(1970, 1, 1, 0, 0, 0,
DateTimeKind
.Utc)).Ticks;
System.Xml (31)
System\Xml\BinaryXml\SqlUtils.cs (3)
756
return new DateTime(yr, mnth, day, hr, min, sec, ms,
DateTimeKind
.Utc);
770
DateTime d = new DateTime(yr, mnth, day, 0, 0, 0,
DateTimeKind
.Utc);
787
return new DateTime(1, 1, 1, hr, min, sec, ms,
DateTimeKind
.Utc);
System\Xml\Schema\DataTypeImplementation.cs (2)
1846
if (dateTime1.Kind ==
DateTimeKind
.Unspecified || dateTime2.Kind ==
DateTimeKind
.Unspecified) { //If either of them are unspecified, do not convert zones
System\Xml\Schema\XsdDateTime.cs (15)
171
case
DateTimeKind
.Unspecified: kind = XsdDateTimeKind.Unspecified; break;
172
case
DateTimeKind
.Utc: kind = XsdDateTimeKind.Zulu; break;
175
Debug.Assert(dateTime.Kind ==
DateTimeKind
.Local, "Unknown DateTimeKind: " + dateTime.Kind);
246
public
DateTimeKind
Kind {
250
return
DateTimeKind
.Unspecified;
252
return
DateTimeKind
.Utc;
256
return
DateTimeKind
.Local;
345
return new DateTime(dt.Ticks,
DateTimeKind
.Utc);
348
return new DateTime(dt.Subtract(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks,
DateTimeKind
.Utc);
351
return new DateTime(dt.Add(new TimeSpan(ZoneHour, ZoneMinute, 0)).Ticks,
DateTimeKind
.Utc);
399
result = new DateTime(result.Ticks,
DateTimeKind
.Utc);
410
return new DateTime(ticks,
DateTimeKind
.Local);
412
result = new DateTime(ticks,
DateTimeKind
.Utc).ToLocalTime();
423
return new DateTime(ticks,
DateTimeKind
.Local);
425
result = new DateTime(ticks,
DateTimeKind
.Utc).ToLocalTime();
System\Xml\Serialization\Xmlcustomformatter.cs (1)
78
if (!LocalAppContextSwitches.IgnoreKindInUtcTimeSerialization && value.Kind ==
DateTimeKind
.Utc)
System\Xml\XmlConvert.cs (10)
783
value = new DateTime(value.Ticks,
DateTimeKind
.Unspecified);
1279
dt = new DateTime(dt.Ticks,
DateTimeKind
.Unspecified);
1343
case
DateTimeKind
.Local:
1346
case
DateTimeKind
.Unspecified:
1347
return new DateTime(value.Ticks,
DateTimeKind
.Local);
1349
case
DateTimeKind
.Utc:
1357
case
DateTimeKind
.Utc:
1360
case
DateTimeKind
.Unspecified:
1361
return new DateTime(value.Ticks,
DateTimeKind
.Utc);
1363
case
DateTimeKind
.Local: