Implemented interface member:
method
ToString
System.IFormattable.ToString(System.String, System.IFormatProvider)
131 references to ToString
aspire (7)
Commands\LogsCommand.cs (1)
348return timestamp.ToString("yyyy-MM-ddTHH:mm:ss.fffK", CultureInfo.InvariantCulture);
Diagnostics\FileLoggerProvider.cs (1)
176var ts = timestamp.UtcDateTime.ToString("yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture);
Interaction\SpectreConsoleLoggerProvider.cs (1)
59var timestamp = DateTime.Now.ToString("HH:mm:ss", CultureInfo.InvariantCulture);
src\Shared\FormatHelpers.cs (3)
41.ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture); 51return local.ToString(pattern, cultureInfo); 61return local.ToString(pattern, cultureInfo);
Utils\ConsoleActivityLogger.cs (1)
376var time = DateTime.Now.ToString("HH:mm:ss", CultureInfo.InvariantCulture);
Aspire.Dashboard (5)
Components\Controls\LogViewer.razor.cs (2)
127? timestamp.UtcDateTime.ToString(KnownFormats.ConsoleLogsUITimestampUtcFormat, CultureInfo.InvariantCulture) 128: TimeProvider.ToLocal(timestamp).ToString(KnownFormats.ConsoleLogsUITimestampLocalFormat, CultureInfo.InvariantCulture);
src\Shared\FormatHelpers.cs (3)
41.ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture); 51return local.ToString(pattern, cultureInfo); 61return local.ToString(pattern, cultureInfo);
Aspire.Hosting (1)
ApplicationModel\ResourceLoggerService.cs (1)
619content = entry.Timestamp.Value.ToString(KnownFormats.ConsoleLogsTimestampFormat, CultureInfo.InvariantCulture) + " " + content;
Aspire.Hosting.Foundry (1)
HostedAgent\HostedAgentConfiguration.cs (1)
32{ "DeployedOn", DateTime.UtcNow.ToString("o", CultureInfo.InvariantCulture) }
Aspire.Hosting.Tests (2)
Dashboard\DashboardLifecycleHookTests.cs (2)
609Timestamp = timestamp.ToString(KnownFormats.ConsoleLogsTimestampFormat, CultureInfo.InvariantCulture), 636Timestamp = timestamp.ToString(KnownFormats.ConsoleLogsTimestampFormat, CultureInfo.InvariantCulture),
dotnet-svcutil-lib (12)
CommandProcessorOptions.cs (1)
582var sessionDirName = DateTime.Now.ToString("yyyy_MMM_dd_HH_mm_ss", CultureInfo.InvariantCulture);
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\SqlUtils.cs (2)
874return dateTime.ToString(format, CultureInfo.InvariantCulture); 896return dateTime.ToString("yyyy/MM/dd\\THH:mm:ss", CultureInfo.InvariantCulture);
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (1)
841return value.ToString(format, DateTimeFormatInfo.InvariantInfo);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityTimestamp.cs (8)
165throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(string.Format(SRServiceModel.TimeStampHasCreationAheadOfExpiry, this.CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), this.ExpiryTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture)))); 177throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(string.Format(SRServiceModel.TimeStampHasExpiryTimeInPast, this.ExpiryTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), allowedClockSkew))); 183throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(string.Format(SRServiceModel.TimeStampHasCreationTimeInFuture, this.CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), allowedClockSkew))); 189throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(string.Format(SRServiceModel.TimeStampWasCreatedTooLongAgo, this.CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), timeToLive, allowedClockSkew)));
Microsoft.Analyzers.Local (1)
ApiLifecycle\Json\JsonValue.cs (1)
413: new JsonValue(value.Value.ToString("o", CultureInfo.InvariantCulture));
Microsoft.Analyzers.Local.Tests (5)
Json\JsonValueTest.cs (5)
73Assert.True(new JsonValue(DateTime.Now.ToString("o", CultureInfo.InvariantCulture)).IsDateTime); 161Assert.Equal(now, new JsonValue(now.ToString("o", CultureInfo.InvariantCulture)).AsDateTime); 211Assert.Equal(time.ToString("o", CultureInfo.InvariantCulture), ((JsonValue)time).AsString); 300Assert.Equal(now, (DateTime)new JsonValue(now.ToString("o", CultureInfo.InvariantCulture))); 305Assert.Equal(now, (DateTime?)new JsonValue(now.ToString("o", CultureInfo.InvariantCulture)));
Microsoft.AspNetCore.Components (7)
BindConverter.cs (7)
345return value.ToString(format, culture ?? CultureInfo.CurrentCulture); 371/// <param name="format">The format to use. Provided to <see cref="DateTime.ToString(string, IFormatProvider)"/>.</param> 388return value.Value.ToString(format, culture ?? CultureInfo.CurrentCulture); 518return value.ToDateTime(TimeOnly.MinValue).ToString(format, culture ?? CultureInfo.CurrentCulture); 562return value.Value.ToDateTime(TimeOnly.MinValue).ToString(format, culture ?? CultureInfo.CurrentCulture); 606return DateTime.MinValue.Add(value.ToTimeSpan()).ToString(format, culture ?? CultureInfo.CurrentCulture); 650return DateTime.MinValue.Add(value.Value.ToTimeSpan()).ToString(format, culture ?? CultureInfo.CurrentCulture);
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\XmlKeyManager.cs (1)
160return dateTime.UtcDateTime.ToString("yyyyMMddTHHmmssFFFFFFFZ", CultureInfo.InvariantCulture);
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
148builder.Append(dateTime.ToString("yyyy'-'MM'-'dd'T'HH:mm:ss", CultureInfo.InvariantCulture));
Microsoft.AspNetCore.Grpc.Swagger (1)
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (1)
148builder.Append(dateTime.ToString("yyyy'-'MM'-'dd'T'HH:mm:ss", CultureInfo.InvariantCulture));
Microsoft.AspNetCore.HttpLogging (3)
W3CLoggerProcessor.cs (1)
29await WriteMessageAsync("#Start-Date: " + DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), streamWriter, cancellationToken);
W3CLoggingMiddleware.cs (2)
84shouldLog |= AddToList(elements, _dateIndex, now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)); 89shouldLog |= AddToList(elements, _timeIndex, now.ToString("HH:mm:ss", CultureInfo.InvariantCulture));
Microsoft.Build (2)
Logging\LogFormatter.cs (1)
39return timeStamp.ToString("HH:mm:ss.fff", CultureInfo.CurrentCulture);
src\msbuild\src\Shared\Debugging\DebugUtils.cs (1)
150writer.WriteLine(DateTime.Now.ToString("G", CultureInfo.CurrentCulture));
Microsoft.Build.Tasks.Core (1)
src\msbuild\src\Shared\Debugging\DebugUtils.cs (1)
150writer.WriteLine(DateTime.Now.ToString("G", CultureInfo.CurrentCulture));
Microsoft.Build.Utilities.Core (1)
src\msbuild\src\Shared\Debugging\DebugUtils.cs (1)
150writer.WriteLine(DateTime.Now.ToString("G", CultureInfo.CurrentCulture));
Microsoft.CodeAnalysis.Features (1)
EmbeddedLanguages\DateAndTime\EmbeddedCompletionContext.cs (1)
103formattedDate = s_exampleDateTime.ToString(formatString, culture);
Microsoft.CodeAnalysis.VisualBasic (1)
SymbolDisplay\ObjectDisplay.vb (1)
331Return value.ToString("#M/d/yyyy hh:mm:ss tt#", CultureInfo.InvariantCulture)
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesExtensions.cs (1)
225.ToString("D", CultureInfo.InvariantCulture);
Microsoft.Maui (1)
Platform\TimeExtensions.cs (1)
26 return DateTime.Today.Add(time).ToString(format, cultureInfo);
Microsoft.TestPlatform.CrossPlatEngine (2)
Client\ProxyOperationManager.cs (1)
474DateTime.Now.ToString("yy-MM-dd_HH-mm-ss_fffff", CultureInfo.InvariantCulture),
DataCollection\ProxyDataCollectionManager.cs (1)
334DateTime.Now.ToString("yy-MM-dd_HH-mm-ss_fffff", CultureInfo.CurrentCulture),
Microsoft.VisualBasic.Core (15)
Microsoft\VisualBasic\CompilerServices\Conversions.vb (3)
2221Return Value.ToString("T", Nothing) 2224Return Value.ToString("d", Nothing) 2226Return Value.ToString("G", Nothing)
Microsoft\VisualBasic\CompilerServices\StringType.vb (3)
74Return Value.ToString("T", Nothing) 77Return Value.ToString("d", Nothing) 79Return Value.ToString(GENERAL_FORMAT, Nothing)
Microsoft\VisualBasic\CompilerServices\VB6File.vb (1)
2341Return dt.ToString(sFormat, m_WriteDateFormatInfo)
Microsoft\VisualBasic\Strings.vb (8)
1139ReturnValue = CDate(Expression).ToString("T", Nothing) 1145ReturnValue = CDate(Expression).ToString("D", Nothing) 1166ReturnValue = CDate(Expression).ToString("t", Nothing) 1172ReturnValue = CDate(Expression).ToString("d", Nothing) 1198ReturnValue = CDate(Expression).ToString("T", Nothing) 1204ReturnValue = CDate(Expression).ToString("D", Nothing) 1213ReturnValue = CDate(Expression).ToString("G", Nothing) 1422Return Expression.ToString(sFormat, Nothing)
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\Logging\FileLogTraceListener.vb (2)
159fileName += $"-{Now.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture)}" 163fileName += $"-{_firstDayOfWeek.Date.ToString(DATE_FORMAT, CultureInfo.InvariantCulture)}"
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (2)
HtmlLogger.cs (2)
304logFilePrefixValue = logFilePrefixValue + DateTime.Now.ToString("_yyyyMMdd_HHmmss.fffffff", DateTimeFormatInfo.InvariantInfo) + $".{HtmlLoggerConstants.HtmlFileExtension}"; 385return timeStamp.ToString("yyyyMMdd_HHmmss.fffffff", DateTimeFormatInfo.InvariantInfo);
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (4)
ObjectModel\TestRun.cs (1)
195return timeStamp.ToString("yyyy-MM-dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo);
Utility\TrxFileHelper.cs (1)
148var tryMe = fileNamePrefix + iterationStamp.ToString(timestampFormat, DateTimeFormatInfo.InvariantInfo) + extension;
XML\XmlPersistence.cs (2)
563return dateTime.ToString(DateTimeUtcPersistenceFormat, CultureInfo.InvariantCulture.DateTimeFormat); 570return localDateTime.ToString(DateTimePersistenceFormat, CultureInfo.InvariantCulture.DateTimeFormat);
MSBuild (1)
src\msbuild\src\Shared\Debugging\DebugUtils.cs (1)
150writer.WriteLine(DateTime.Now.ToString("G", CultureInfo.CurrentCulture));
NuGet.Common (2)
Telemetry\TelemetryActivity.cs (2)
121TelemetryEvent["StartTime"] = _startTime.ToString("O", CultureInfo.CurrentCulture); 122TelemetryEvent["EndTime"] = endTime.ToString("O", CultureInfo.CurrentCulture);
NuGet.PackageManagement (2)
Telemetry\ActionEventBase.cs (2)
33{ nameof(StartTime), startTime.UtcDateTime.ToString("O", CultureInfo.InvariantCulture) }, 34{ nameof(EndTime), endTime.UtcDateTime.ToString("O", CultureInfo.InvariantCulture) },
NuGet.Packaging (2)
PackagesConfigWriter.cs (2)
527@"packages.config.old." + DateTime.Now.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture)); 555@"packages.config.new." + DateTime.Now.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture));
NuGet.Protocol (2)
Plugins\Logging\PluginLogMessage.cs (1)
33["now"] = _now.ToString("O", CultureInfo.InvariantCulture), // round-trip format
Plugins\Logging\ProcessLogMessage.cs (1)
34["process start time"] = _processStartTime.ToString("O", CultureInfo.CurrentCulture),
PresentationFramework (4)
System\Windows\Controls\DatePicker.cs (2)
1001return d.ToString(dtfi.ShortDatePattern, dtfi); 1006return d.ToString(dtfi.LongDatePattern, dtfi);
System\Windows\Controls\DateTimeHelper.cs (2)
227result = date.Value.ToString(format.YearMonthPattern, format); 270result = date.Value.Date.ToString(format.LongDatePattern, format);
ReachFramework (1)
Packaging\XPSSignatureDefinition.cs (1)
379writer.WriteString(((DateTime)SignBy).ToUniversalTime().ToString("s", DateTimeFormatInfo.InvariantInfo) + "Z");
System.ComponentModel.TypeConverter (2)
System\ComponentModel\DateTimeConverter.cs (2)
99return dt.ToString("yyyy-MM-dd", culture); 117return dt.ToString(format, culture);
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\DelimitedListTraceListener.cs (1)
190WriteEscaped(eventCache.DateTime.ToString("o", CultureInfo.InvariantCulture));
System.Formats.Cbor (1)
System\Formats\Cbor\Writer\CborWriter.Tag.cs (1)
42value.UtcDateTime.ToString(Rfc3339FormatString, CultureInfo.InvariantCulture) : // prefer 'Z' over '+00:00'
System.Net.HttpListener (1)
System\Net\Managed\HttpListenerResponse.Managed.cs (1)
173_webHeaders.Set(HttpKnownHeaderNames.Date, DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture));
System.Private.DataContractSerialization (2)
System\Runtime\Serialization\ExtensionDataReader.cs (1)
693_value = dateTime.ToString("yyyy-MM-ddTHH:mm:ss.fffffffK", DateTimeFormatInfo.InvariantInfo);
System\Runtime\Serialization\Json\JsonWriterDelegator.cs (1)
169writer.WriteString(value.ToString(_dateTimeFormat.FormatString, _dateTimeFormat.FormatProvider));
System.Private.Xml (4)
System\Xml\BinaryXml\SqlUtils.cs (2)
581return dateTime.ToString(format, CultureInfo.InvariantCulture); 602return dateTime.ToString("yyyy/MM/dd\\THH:mm:ss", CultureInfo.InvariantCulture);
System\Xml\XmlConvert.cs (1)
699return value.ToString(format, DateTimeFormatInfo.InvariantInfo);
System\Xml\Xsl\Runtime\XsltFunctions.cs (1)
384return dt.ToString(format, ci);
System.Runtime.Caching (8)
System\Runtime\Caching\CacheExpires.cs (4)
571",now=" + DateTime.Now.ToString("o", CultureInfo.InvariantCulture) + 679" expired items, bucket=" + _bucket + "; Time=" + DateTime.Now.ToString("o", CultureInfo.InvariantCulture)); 743" expired items, bucket=" + _bucket + "; Time=" + DateTime.Now.ToString("o", CultureInfo.InvariantCulture)); 816Dbg.Trace("CacheExpiresFlushTotal", "FlushExpiredItems flushed a total of " + flushed + " items; Time=" + DateTime.Now.ToString("o", CultureInfo.InvariantCulture));
System\Runtime\Caching\CacheUsage.cs (2)
748" underused items; Time=" + DateTime.Now.ToString("o", CultureInfo.InvariantCulture)); 807" underused items; Time=" + DateTime.Now.ToString("o", CultureInfo.InvariantCulture));
System\Runtime\Caching\MemoryCacheStatistics.cs (1)
279Dbg.Trace("MemoryCacheStats", "**BEG** CacheManagerThread " + DateTime.Now.ToString("T", CultureInfo.InvariantCulture));
System\Runtime\Caching\MemoryMonitor.cs (1)
88+ " " + DateTime.Now.ToString("o", CultureInfo.InvariantCulture));
System.ServiceModel.Primitives (10)
System\ServiceModel\Security\SecurityTimestamp.cs (8)
159throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SRP.Format(SRP.TimeStampHasCreationAheadOfExpiry, CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), ExpiryTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture)))); 171throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SRP.Format(SRP.TimeStampHasExpiryTimeInPast, ExpiryTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), allowedClockSkew))); 177throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SRP.Format(SRP.TimeStampHasCreationTimeInFuture, CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), allowedClockSkew))); 183throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new MessageSecurityException(SRP.Format(SRP.TimeStampWasCreatedTooLongAgo, CreationTimeUtc.ToString(DefaultFormat, CultureInfo.CurrentCulture), now.ToString(DefaultFormat, CultureInfo.CurrentCulture), timeToLive, allowedClockSkew)));
System\ServiceModel\Security\WSTrust.cs (2)
1126writer.WriteString(effectiveTime.ToString("yyyy-MM-ddTHH:mm:ss.fffZ", CultureInfo.InvariantCulture.DateTimeFormat)); 1130writer.WriteString(expirationTime.ToString("yyyy-MM-ddTHH:mm:ss.fffZ", CultureInfo.InvariantCulture.DateTimeFormat));
System.Windows.Forms (2)
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (1)
1007return value.ToString("G", CultureInfo.CurrentCulture);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
1133private static string FormatDate(DateTime value) => value.ToString("d", CultureInfo.CurrentCulture);
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\FormatControl.cs (1)
446return _value.ToString(FormatString, CultureInfo.CurrentCulture);
System\Windows\Forms\Design\FormatControl.CustomFormatType.cs (2)
38label = s_dateTimeFormatValue.ToString(formatString, CultureInfo.CurrentCulture); 75label = s_dateTimeFormatValue.ToString(formatString, CultureInfo.CurrentCulture);
System\Windows\Forms\Design\FormatControl.DateTimeFormatType.cs (1)
31return s_dateTimeFormatValue.ToString(FormatString, CultureInfo.CurrentCulture);
System.Xaml (1)
System\Windows\Markup\DateTimeValueSerializer.cs (1)
106return dateTime.ToString(formatString, DateTimeFormatInfo.InvariantInfo);
WithDockerfile.AppHost (1)
Program.cs (1)
23var timestamp = DateTime.Now.ToString("yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture);