当前位置: 首页>>代码示例>>C++>>正文


C++ FDateTime::ToString方法代码示例

本文整理汇总了C++中FDateTime::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ FDateTime::ToString方法的具体用法?C++ FDateTime::ToString怎么用?C++ FDateTime::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FDateTime的用法示例。


在下文中一共展示了FDateTime::ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ToDateTimeZoneString

FString FDateTimeStructCustomization::ToDateTimeZoneString(const FDateTime& UTCDate)
{
	const int32 DisplayTimezone = GetLocalTimezone();
	const FDateTime LocalTime = ConvertTime(UTCDate, TIMEZONE_UTC, DisplayTimezone);
	return FString::Printf(TEXT("%s %s%0.4d"), *LocalTime.ToString(), (DisplayTimezone >= 0 ? TEXT("+") : TEXT("")), DisplayTimezone);

}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:7,代码来源:DateTimeStructCustomization.cpp

示例2: StartQosPass

void FQosDatacenterStats::StartQosPass()
{
	if (!bAnalyticsInProgress)
	{
		FDateTime UTCTime = FDateTime::UtcNow();
		QosData.Timestamp = UTCTime.ToString();

		StartTimer(QosData.SearchTime);
		bAnalyticsInProgress = true;
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:11,代码来源:QosStats.cpp

示例3: AsDateTime

FText FText::AsDateTime( const FDateTime& DateTime, const EDateTimeStyle::Type DateStyle, const EDateTimeStyle::Type TimeStyle, const FString& TimeZone, const FCulturePtr& TargetCulture )
{
	checkf(FInternationalization::Get().IsInitialized() == true, TEXT("FInternationalization is not initialized. An FText formatting method was likely used in static object initialization - this is not supported."));
	return FText::FromString(DateTime.ToString(TEXT("%Y.%m.%d-%H.%M.%S")));
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:5,代码来源:LegacyText.cpp

示例4: SaveCookedPackageAssetRegistry

// cooked package asset registry saves information about all the cooked packages and assets contained within for stats purposes
// in json format
bool FChunkManifestGenerator::SaveCookedPackageAssetRegistry( const FString& SandboxCookedRegistryFilename, const bool Append )
{
	bool bSuccess = false;
	for ( const auto& Platform : Platforms )
	{
		TSet<FName> CookedPackages;

		// save the file 
		const FString CookedAssetRegistryFilename = SandboxCookedRegistryFilename.Replace(TEXT("[Platform]"), *Platform->PlatformName());

		FString JsonOutString;
		JsonWriter Json = TJsonWriterFactory<TCHAR, TPrettyJsonPrintPolicy<TCHAR> >::Create(&JsonOutString);

		Json->WriteObjectStart();
		Json->WriteArrayStart(TEXT("Packages"));

		for ( const auto& Package : AllCookedPackages )
		{
			Json->WriteObjectStart(); // unnamed package start
			const FName& PackageName = Package.Key;
			const FString& SandboxPath = Package.Value;

			CookedPackages.Add( PackageName );

			FString PlatformSandboxPath = SandboxPath.Replace(TEXT("[Platform]"), *Platform->PlatformName());
			
			FDateTime TimeStamp = IFileManager::Get().GetTimeStamp( *PlatformSandboxPath );

			Json->WriteValue( "SourcePackageName", PackageName.ToString() );
			Json->WriteValue( "CookedPackageName", PlatformSandboxPath );
			Json->WriteValue( "CookedPackageTimeStamp", TimeStamp.ToString() );
			
			Json->WriteArrayStart("AssetData");
			for (const auto& AssetData : AssetRegistryData)
			{	// Add only assets that have actually been cooked and belong to any chunk
				if (AssetData.ChunkIDs.Num() > 0 && (AssetData.PackageName == PackageName))
				{
					Json->WriteObjectStart();
					// save all their infos 
					Json->WriteValue(TEXT("ObjectPath"), AssetData.ObjectPath.ToString() );
					Json->WriteValue(TEXT("PackageName"), AssetData.PackageName.ToString() );
					Json->WriteValue(TEXT("PackagePath"), AssetData.PackagePath.ToString() );
					Json->WriteValue(TEXT("GroupNames"), AssetData.GroupNames.ToString() );
					Json->WriteValue(TEXT("AssetName"), AssetData.AssetName.ToString() );
					Json->WriteValue(TEXT("AssetClass"), AssetData.AssetClass.ToString() );
					Json->WriteObjectStart("TagsAndValues");
					for ( const auto& Tag : AssetData.TagsAndValues )
					{
						Json->WriteValue( Tag.Key.ToString(), Tag.Value );
					}
					Json->WriteObjectEnd(); // end tags and values object
					Json->WriteObjectEnd(); // end unnamed array object
				}
			}
			Json->WriteArrayEnd();
			Json->WriteObjectEnd(); // unnamed package
		}

		if ( Append )
		{
			FString JsonInString;
			if ( FFileHelper::LoadFileToString(JsonInString, *CookedAssetRegistryFilename) )
			{
				// load up previous package asset registry and fill in any packages which weren't recooked on this run
				JsonReader Reader = TJsonReaderFactory<TCHAR>::Create(JsonInString);
				TSharedPtr<FJsonObject> JsonObject;
				bool shouldRead = FJsonSerializer::Deserialize(Reader, JsonObject) && JsonObject.IsValid() && JsonObject->HasTypedField<EJson::Array>(TEXT("Packages"));
				if ( shouldRead )
				{
					TArray<TSharedPtr<FJsonValue>> PackageList = JsonObject->GetArrayField(TEXT("Packages"));
					for (auto PackageListIt = PackageList.CreateConstIterator(); PackageListIt && shouldRead; ++PackageListIt)
					{
						const TSharedPtr<FJsonValue>& JsonValue = *PackageListIt;
						shouldRead = JsonValue->Type == EJson::Object;
						if ( shouldRead )
						{
							const TSharedPtr<FJsonObject>& JsonPackage = JsonValue->AsObject();

							// get the package name and see if we have already written it out this run
							
							FString CookedPackageName;
							verify( JsonPackage->TryGetStringField(TEXT("SourcePackageName"), CookedPackageName) );

							const FName CookedPackageFName(*CookedPackageName);
							if ( CookedPackages.Contains(CookedPackageFName))
							{
								// don't need to process this package
								continue;
							}


							// check that the on disk version is still valid
							FString SourcePackageName;
							check( JsonPackage->TryGetStringField( TEXT("SourcePackageName"), SourcePackageName) );

							// if our timestamp is different then don't copy the information over
							FDateTime CurrentTimeStamp = IFileManager::Get().GetTimeStamp( *CookedPackageName );

//.........这里部分代码省略.........
开发者ID:Codermay,项目名称:Unreal4,代码行数:101,代码来源:ChunkManifestGenerator.cpp


注:本文中的FDateTime::ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。