1 FDateTime Time = FDateTime::Now(); 2 //获取时间戳 3 int64 Timestamp = Time.ToUnixTimestamp(); 4 UE_LOG(LogTemp, Warning, TEXT("%d"), Timestamp);
将 Unix Timestamp 转换为年月日(year, month, day)
1 FDateTime Time = FDateTime::FromUnixTimestamp(int64 UnixTime);
获取系统当前日期时间:年月日时分秒
int64 Timestamp = Time.ToUnixTimestamp(); UE_LOG(LogTemp, Warning, TEXT("%d"), Timestamp); int year = Time.GetYear(); int month = Time.GetMonth(); int day = Time.GetDay(); int hour = Time.GetHour(); int minute = Time.GetMinute(); int second = Time.GetSecond(); UE_LOG(LogTemp, Warning, TEXT("时间:%d, %d, %d, %d, %d, %d"), year, month, day, hour, minute, second);
原文地址:https://blog.csdn.net/weixin_41946900/article/details/103068557