Implemented interface member:
method
ToString
System.IFormattable.ToString(System.String, System.IFormatProvider)
68 references to ToString
Aspire.Azure.Security.KeyVault.Tests (1)
AspireKeyVaultExtensionsTests.cs (1)
161response.AddHeader(new HttpHeader("Date", DateTimeOffset.UtcNow.ToString("r", CultureInfo.InvariantCulture)));
Aspire.Dashboard (1)
Components\Pages\ConsoleLogs.razor.cs (1)
904return $"{fileNamePrefix}-{TimeProvider.GetLocalNow().ToString("yyyyMMddhhmmss", CultureInfo.InvariantCulture)}.txt";
Aspire.Dashboard.Components.Tests (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
72DateTimeOffset.UtcNow.ToString("s", CultureInfo.InvariantCulture);
Aspire.Dashboard.Tests (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
72DateTimeOffset.UtcNow.ToString("s", CultureInfo.InvariantCulture);
Aspire.Hosting (1)
VersionChecking\VersionCheckService.cs (1)
102SecretsStore.TrySetUserSecret(_options.Assembly, LastCheckDateKey, now.ToString("o", CultureInfo.InvariantCulture));
Aspire.Hosting.Testing.Tests (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
72DateTimeOffset.UtcNow.ToString("s", CultureInfo.InvariantCulture);
Aspire.Hosting.Tests (4)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
72DateTimeOffset.UtcNow.ToString("s", CultureInfo.InvariantCulture);
VersionChecking\VersionCheckServiceTests.cs (3)
78[VersionCheckService.LastCheckDateKey] = lastCheckDate.ToString("o", CultureInfo.InvariantCulture) 113[VersionCheckService.LastCheckDateKey] = lastCheckDate.ToString("o", CultureInfo.InvariantCulture), 153[VersionCheckService.LastCheckDateKey] = lastCheckDate.ToString("o", CultureInfo.InvariantCulture),
Aspire.Playground.Tests (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
72DateTimeOffset.UtcNow.ToString("s", CultureInfo.InvariantCulture);
dotnet-svcutil-lib (1)
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (1)
881return value.ToString(format, DateTimeFormatInfo.InvariantInfo);
Microsoft.AspNetCore.Authentication.Abstractions (1)
AuthenticationProperties.cs (1)
219Items[key] = value.GetValueOrDefault().ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Authentication.Core.Test (1)
AuthenticationPropertiesTests.cs (1)
260props.Items["foo"] = dateTimeOffset.ToString("r", CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
174Value = expiresAt.ToString("o", CultureInfo.InvariantCulture)
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
OpenIdConnectHandler.cs (1)
1141tokens.Add(new AuthenticationToken { Name = "expires_at", Value = expiresAt.ToString("o", CultureInfo.InvariantCulture) });
Microsoft.AspNetCore.Components (5)
BindConverter.cs (5)
333/// <param name="format">The format to use. Provided to <see cref="DateTimeOffset.ToString(string, IFormatProvider)"/>.</param> 419/// <param name="format">The format to use. Provided to <see cref="DateTimeOffset.ToString(string, IFormatProvider)"/>.</param> 431return value.ToString(format, culture ?? CultureInfo.CurrentCulture); 457/// <param name="format">The format to use. Provided to <see cref="DateTimeOffset.ToString(string, IFormatProvider)"/>.</param> 474return value.Value.ToString(format, culture ?? CultureInfo.CurrentCulture);
Microsoft.AspNetCore.HeaderParsing.Tests (16)
HeaderParsingExtensionsTests.cs (3)
106var date = DateTimeOffset.UtcNow.ToString("R", CultureInfo.InvariantCulture); 113Assert.Equal(date, parsedDate.ToString("R", CultureInfo.InvariantCulture)); 117Assert.Equal(date, parsedDate.ToString("R", CultureInfo.InvariantCulture));
HeaderParsingFeatureTests.cs (12)
46var date = DateTimeOffset.Now.ToString("R", CultureInfo.InvariantCulture); 54Assert.Equal(date, value.ToString("R", CultureInfo.InvariantCulture)); 63var currentDate = DateTimeOffset.Now.ToString("R", CultureInfo.InvariantCulture); 64var futureDate = DateTimeOffset.Now.AddHours(1).ToString("R", CultureInfo.InvariantCulture); 73Assert.Equal(currentDate, value.ToString("R", CultureInfo.InvariantCulture)); 79Assert.Equal(futureDate, textValue.ToString("R", CultureInfo.InvariantCulture)); 88var date = DateTimeOffset.Now.ToString("R", CultureInfo.InvariantCulture); 97Assert.Equal(date, value.ToString("R", CultureInfo.InvariantCulture)); 120var date = DateTimeOffset.Now.ToString("R", CultureInfo.InvariantCulture); 127Assert.Equal(date, value.ToString("R", CultureInfo.InvariantCulture)); 178Context.Request.Headers[firstHeaderKey.Name] = DateTimeOffset.Now.ToString("R", CultureInfo.InvariantCulture); 179Context.Request.Headers[thirdHeaderKey.Name] = DateTimeOffset.Now.ToString("R", CultureInfo.InvariantCulture);
HeaderRegistryTests.cs (1)
40var date = DateTimeOffset.Now.ToString("R", CultureInfo.InvariantCulture);
Microsoft.AspNetCore.InternalTesting (4)
AssemblyTestLog.cs (3)
79logger.LogInformation("Starting test {testName} at {logStart}", testName, logStart.ToString("s", CultureInfo.InvariantCulture)); 216logStart.ToString("s", CultureInfo.InvariantCulture)); 338: DateTimeOffset.UtcNow.ToString("s", CultureInfo.InvariantCulture)));
Logging\XunitLoggerProvider.cs (1)
74DateTimeOffset.UtcNow.ToString("s", CultureInfo.InvariantCulture);
Microsoft.AspNetCore.StaticAssets (1)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
195_context.Response.Headers.LastModified = fileInfo.LastModified.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture);
Microsoft.AspNetCore.StaticAssets.Tests (4)
StaticAssetsIntegrationTests.cs (4)
507new("Last-Modified", lastModified.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture)), 529new ("Last-Modified", lastModified.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture)), 585new("Last-Modified", new DateTimeOffset(2023,03,03,0,0,0,TimeSpan.Zero).ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture)) 927req2.Headers.TryAddWithoutValidation("If-Modified-Since", DateTimeOffset.UtcNow.ToString(format, CultureInfo.InvariantCulture));
Microsoft.AspNetCore.StaticFiles.Tests (1)
CacheHeaderTests.cs (1)
355.AddHeader("If-Modified-Since", DateTimeOffset.UtcNow.ToString(format, CultureInfo.InvariantCulture))
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\CollectedMeasurement.cs (1)
109internal string DebuggerToString() => $"{Value} @ {Timestamp.ToString("HH:mm:ss.ffff", CultureInfo.InvariantCulture)}";
Microsoft.Extensions.Logging.AzureAppServices (1)
BatchingLogger.cs (1)
39builder.Append(timestamp.ToString("yyyy-MM-dd HH:mm:ss.fff zzz", CultureInfo.InvariantCulture));
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
72DateTimeOffset.UtcNow.ToString("s", CultureInfo.InvariantCulture);
Microsoft.Extensions.TimeProvider.Testing (1)
FakeTimeProvider.cs (1)
200public override string ToString() => _now.ToString("yyyy-MM-ddTHH:mm:ss.fff", CultureInfo.InvariantCulture);
Microsoft.Net.Http.Headers (1)
HeaderUtilities.cs (1)
581return dateTime.ToString("r", CultureInfo.InvariantCulture);
OpenIdConnectSample (1)
Startup.cs (1)
272props.UpdateTokenValue("expires_at", expiresAt.ToString("o", CultureInfo.InvariantCulture));
SocialSample (2)
Startup.cs (2)
346authProperties.UpdateTokenValue("expires_at", expiresAt.ToString("o", CultureInfo.InvariantCulture)); 376authProperties.UpdateTokenValue("expires_at", expiresAt.ToString("o", CultureInfo.InvariantCulture));
System.ComponentModel.TypeConverter (2)
System\ComponentModel\DateTimeOffsetConverter.cs (2)
109return dto.ToString("yyyy-MM-dd zzz", culture); 129return dto.ToString(format, culture);
System.Formats.Cbor (1)
System\Formats\Cbor\Writer\CborWriter.Tag.cs (1)
47value.ToString(Rfc3339FormatString, CultureInfo.InvariantCulture);
System.Private.Xml (1)
System\Xml\XmlConvert.cs (1)
737return value.ToString(format, DateTimeFormatInfo.InvariantInfo);
System.ServiceModel.Syndication (4)
System\ServiceModel\Syndication\Atom10FeedFormatter.cs (2)
582return dateTime.ToUniversalTime().ToString(Rfc3339UTCDateTimeFormat, CultureInfo.InvariantCulture); 586return dateTime.ToString(Rfc3339LocalDateTimeFormat, CultureInfo.InvariantCulture);
System\ServiceModel\Syndication\Rss20FeedFormatter.cs (2)
183return dateTime.ToUniversalTime().ToString(Rfc822OutputUtcDateTimeFormat, CultureInfo.InvariantCulture); 187StringBuilder sb = new StringBuilder(dateTime.ToString(Rfc822OutputLocalDateTimeFormat, CultureInfo.InvariantCulture));
System.Xaml (1)
System\Xaml\Replacements\DateTimeOffsetConverter2.cs (1)
41return dtOffset.ToString("O", culture ?? CultureInfo.CurrentCulture);
System.Xaml.Tests (4)
System\Xaml\Replacements\DateTimeOffsetConverter2Tests.cs (4)
32yield return new object?[] { dateTimeOffset.ToString("O", CultureInfo.CurrentCulture), null, dateTimeOffset }; 33yield return new object?[] { " " + dateTimeOffset.ToString("O", CultureInfo.CurrentCulture) + " ", null, dateTimeOffset }; 34yield return new object?[] { dateTimeOffset.ToString("O", new CultureInfo("en-US")), new CultureInfo("en-US"), dateTimeOffset }; 80Assert.Equal(dateTimeOffset.ToString("O", culture ?? CultureInfo.CurrentCulture), converter.ConvertTo(null, culture, dateTimeOffset, typeof(string)));