(39) 's Extra Blueprint Nodes for You as a Plugin, No C++ Required!

Hi there!

Welcome to the forums!

The UE4 function itself declares that it does not return milliseconds:



/**
	 * Returns the string representation of  date using a default format.
	 *
	 * The returned string has the following format:
	 *		yyyy.mm.dd-hh.mm.ss
	 *
	 * @return String representation.
	 * @see Parse, ToIso8601
	 */
	CORE_API FString ToString() const;


Yet, as you say, the parsing function which takes the string accepts it if milliseconds are added onto the end.

For the sake of the node itself it makes more sense if the string includes the milliseconds :slight_smile:

BP node Update

So I’ve updated my BP node!



FString UVictoryBPFunctionLibrary::RealWorldTime__GetCurrentOSTime( 
	int32& MilliSeconds,
	int32& Seconds, 
	int32& Minutes, 
	int32& Hours12,
	int32& Hours24,
	int32& Day,
	int32& Month,
	int32& Year
){
	const FDateTime Now = FDateTime::Now();
	
	MilliSeconds = 		Now.GetMillisecond( );
	Seconds = 			Now.GetSecond( );
	Minutes = 				Now.GetMinute( );
	Hours12 = 			Now.GetHour12( );
	Hours24 = 			Now.GetHour( ); //24
	Day = 					Now.GetDay( );
	Month = 				Now.GetMonth( );
	Year = 				Now.GetYear( );
	 
	//MS are not included in FDateTime::ToString(), so adding it
	//The Parse function accepts if MS are present.
	FString NowWithMS = Now.ToString();
	NowWithMS += "." + FString::FromInt(MilliSeconds);
	return NowWithMS;
}


It will be in my next release :slight_smile: