UE5 Unix时间戳转FDateTime

FDateTime UPV3BlueprintFunctionLibrary::UnixToDateTime(int64 UnixTime)
{
    return FDateTime(1970, 1, 1) + FTimespan(0,0,UnixTime);
}

FDateTime UPV3BlueprintFunctionLibrary::UnixStrToDateTime(FString UnixTime)
{
    return FDateTime(1970, 1, 1) + FTimespan(0,0,FCString::Atoi64(*UnixTime));
}

 

posted @ 2024-04-23 15:32  阿华小青蛙  阅读(75)  评论(0编辑  收藏  举报