基于UKismetMathLibrary

DateTime 相关函数

Timespan 运算操作相关函数见尾部附录

/** Returns the date component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetDate"), Category="Math|DateTime")
static FDateTime GetDate( FDateTime A ); /** Returns the day component of A (1 to 31) */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetDay"), Category="Math|DateTime")
static int32 GetDay( FDateTime A ); /** Returns the day of year of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetDayOfYear"), Category="Math|DateTime")
static int32 GetDayOfYear( FDateTime A ); /** Returns the hour component of A (24h format) */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetHour"), Category="Math|DateTime")
static int32 GetHour( FDateTime A ); /** Returns the hour component of A (12h format) */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetHour12"), Category="Math|DateTime")
static int32 GetHour12( FDateTime A ); /** Returns the millisecond component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetMillisecond"), Category="Math|DateTime")
static int32 GetMillisecond( FDateTime A ); /** Returns the minute component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetMinute"), Category="Math|DateTime")
static int32 GetMinute( FDateTime A ); /** Returns the month component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetMonth"), Category="Math|DateTime")
static int32 GetMonth( FDateTime A ); /** Returns the second component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetSecond"), Category="Math|DateTime")
static int32 GetSecond( FDateTime A ); /** Returns the time elapsed since midnight of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetTimeOfDay"), Category="Math|DateTime")
static FTimespan GetTimeOfDay( FDateTime A ); /** Returns the year component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetYear"), Category="Math|DateTime")
static int32 GetYear( FDateTime A ); /** Returns whether A's time is in the afternoon */
UFUNCTION(BlueprintPure, meta=(DisplayName="IsAfternoon"), Category="Math|DateTime")
static bool IsAfternoon( FDateTime A ); /** Returns whether A's time is in the morning */
UFUNCTION(BlueprintPure, meta=(DisplayName="IsMorning"), Category="Math|DateTime")
static bool IsMorning( FDateTime A ); /** Returns the number of days in the given year and month */
UFUNCTION(BlueprintPure, meta=(DisplayName="DaysInMonth"), Category="Math|DateTime")
static int32 DaysInMonth( int32 Year, int32 Month ); /** Returns the number of days in the given year */
UFUNCTION(BlueprintPure, meta=(DisplayName="DaysInYear"), Category="Math|DateTime")
static int32 DaysInYear( int32 Year ); /** Returns whether given year is a leap year */
UFUNCTION(BlueprintPure, meta=(DisplayName="IsLeapYear"), Category="Math|DateTime")
static bool IsLeapYear( int32 Year ); /** Returns the maximum date and time value */
UFUNCTION(BlueprintPure, meta=(DisplayName="MaxValue"), Category="Math|DateTime")
static FDateTime DateTimeMaxValue( ); /** Returns the minimum date and time value */
UFUNCTION(BlueprintPure, meta=(DisplayName="MinValue"), Category="Math|DateTime")
static FDateTime DateTimeMinValue( ); /** Returns the local date and time on this computer */
UFUNCTION(BlueprintPure, meta=(DisplayName="Now"), Category="Math|DateTime")
static FDateTime Now( ); /** Returns the local date on this computer */
UFUNCTION(BlueprintPure, meta=(DisplayName="Today"), Category="Math|DateTime")
static FDateTime Today( ); /** Returns the UTC date and time on this computer */
UFUNCTION(BlueprintPure, meta=(DisplayName="UtcNow"), Category="Math|DateTime")
static FDateTime UtcNow( ); /** Converts a date string in ISO-8601 format to a DateTime object */
UFUNCTION(BlueprintPure, Category="Math|DateTime")
static bool DateTimeFromIsoString(FString IsoString, FDateTime& Result); /** Converts a date string to a DateTime object */
UFUNCTION(BlueprintPure, Category="Math|DateTime")
static bool DateTimeFromString(FString DateTimeString, FDateTime& Result);

Timespan 相关函数

Timespan 运算操作相关函数见尾部附录

/** Returns the days component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetDays"), Category="Math|Timespan")
static int32 GetDays( FTimespan A ); /** Returns the absolute value of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetDuration"), Category="Math|Timespan")
static FTimespan GetDuration( FTimespan A ); /** Returns the hours component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetHours"), Category="Math|Timespan")
static int32 GetHours( FTimespan A ); /** Returns the milliseconds component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetMilliseconds"), Category="Math|Timespan")
static int32 GetMilliseconds( FTimespan A ); /** Returns the minutes component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetMinutes"), Category="Math|Timespan")
static int32 GetMinutes( FTimespan A ); /** Returns the seconds component of A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetSeconds"), Category="Math|Timespan")
static int32 GetSeconds( FTimespan A ); /** Returns the total number of days in A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetTotalDays"), Category="Math|Timespan")
static float GetTotalDays( FTimespan A ); /** Returns the total number of hours in A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetTotalHours"), Category="Math|Timespan")
static float GetTotalHours( FTimespan A ); /** Returns the total number of milliseconds in A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetTotalMilliseconds"), Category="Math|Timespan")
static float GetTotalMilliseconds( FTimespan A ); /** Returns the total number of minutes in A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetTotalMinutes"), Category="Math|Timespan")
static float GetTotalMinutes( FTimespan A ); /** Returns the total number of seconds in A */
UFUNCTION(BlueprintPure, meta=(DisplayName="GetTotalSeconds"), Category="Math|Timespan")
static float GetTotalSeconds( FTimespan A ); /** Returns a time span that represents the specified number of days */
UFUNCTION(BlueprintPure, meta=(DisplayName="FromDays"), Category="Math|Timespan")
static FTimespan FromDays( float Days ); /** Returns a time span that represents the specified number of hours */
UFUNCTION(BlueprintPure, meta=(DisplayName="FromHours"), Category="Math|Timespan")
static FTimespan FromHours( float Hours ); /** Returns a time span that represents the specified number of milliseconds */
UFUNCTION(BlueprintPure, meta=(DisplayName="FromMilliseconds"), Category="Math|Timespan")
static FTimespan FromMilliseconds( float Milliseconds ); /** Returns a time span that represents the specified number of minutes */
UFUNCTION(BlueprintPure, meta=(DisplayName="FromMinutes"), Category="Math|Timespan")
static FTimespan FromMinutes( float Minutes ); /** Returns a time span that represents the specified number of seconds */
UFUNCTION(BlueprintPure, meta=(DisplayName="FromSeconds"), Category="Math|Timespan")
static FTimespan FromSeconds( float Seconds ); /** Returns the ratio between two time spans (A / B), handles zero values */
UFUNCTION(BlueprintPure, meta=(DisplayName="TimespanRatio"), Category="Math|Timespan")
static float TimespanRatio( FTimespan A, FTimespan B ); /** Converts a time span string to a Timespan object */
UFUNCTION(BlueprintPure, Category="Math|Timespan")
static bool TimespanFromString(FString TimespanString, FTimespan& Result);

附录

DateTime 运算操作相关函数

/** Makes a DateTime struct */
UFUNCTION(BlueprintPure, Category="Math|DateTime", meta=(NativeMakeFunc, AdvancedDisplay = "3"))
static FDateTime MakeDateTime(int32 Year, int32 Month, int32 Day, int32 Hour = 0, int32 Minute = 0, int32 Second = 0, int32 Millisecond = 0); /** Breaks a DateTime into its components */
UFUNCTION(BlueprintPure, Category="Math|DateTime", meta=(NativeBreakFunc, AdvancedDisplay = "4"))
static void BreakDateTime(FDateTime InDateTime, int32& Year, int32& Month, int32& Day, int32& Hour, int32& Minute, int32& Second, int32& Millisecond); /** Addition (A + B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="DateTime + Timespan", CompactNodeTitle="+", Keywords="+ add plus"), Category="Math|DateTime")
static FDateTime Add_DateTimeTimespan( FDateTime A, FTimespan B ); /** Subtraction (A - B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="DateTime - Timespan", CompactNodeTitle="-", Keywords="- subtract minus"), Category="Math|DateTime")
static FDateTime Subtract_DateTimeTimespan(FDateTime A, FTimespan B); /** Addition (A + B) */
UFUNCTION(BlueprintPure, meta = (DisplayName = "DateTime + DateTime", CompactNodeTitle = "+", Keywords = "+ add plus"), Category = "Math|DateTime")
static FDateTime Add_DateTimeDateTime(FDateTime A, FDateTime B); /** Subtraction (A - B) */
UFUNCTION(BlueprintPure, meta = (DisplayName = "DateTime - DateTime", CompactNodeTitle = "-", Keywords = "- subtract minus"), Category = "Math|DateTime")
static FTimespan Subtract_DateTimeDateTime(FDateTime A, FDateTime B); /** Returns true if the values are equal (A == B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Equal (DateTime)", CompactNodeTitle="==", Keywords="== equal"), Category="Math|DateTime")
static bool EqualEqual_DateTimeDateTime( FDateTime A, FDateTime B ); /** Returns true if the values are not equal (A != B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Not Equal (DateTime)", CompactNodeTitle="!=", Keywords="!= not equal"), Category="Math|DateTime")
static bool NotEqual_DateTimeDateTime( FDateTime A, FDateTime B ); /** Returns true if A is greater than B (A > B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="DateTime > DateTime", CompactNodeTitle=">", Keywords="> greater"), Category="Math|DateTime")
static bool Greater_DateTimeDateTime( FDateTime A, FDateTime B ); /** Returns true if A is greater than or equal to B (A >= B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="DateTime >= DateTime", CompactNodeTitle=">=", Keywords=">= greater"), Category="Math|DateTime")
static bool GreaterEqual_DateTimeDateTime( FDateTime A, FDateTime B ); /** Returns true if A is less than B (A < B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="DateTime < DateTime", CompactNodeTitle="<", Keywords="< less"), Category="Math|DateTime")
static bool Less_DateTimeDateTime( FDateTime A, FDateTime B ); /** Returns true if A is less than or equal to B (A <= B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="DateTime <= DateTime", CompactNodeTitle="<=", Keywords="<= less"), Category="Math|DateTime")
static bool LessEqual_DateTimeDateTime( FDateTime A, FDateTime B );

Timespan 运算操作相关函数

/** Returns the maximum time span value */
UFUNCTION(BlueprintPure, meta=(DisplayName="MaxValue", ScriptConstant = "MaxValue", ScriptConstantHost = "Timespan"), Category="Math|Timespan")
static FTimespan TimespanMaxValue( ); /** Returns the minimum time span value */
UFUNCTION(BlueprintPure, meta=(DisplayName="MinValue", ScriptConstant = "MinValue", ScriptConstantHost = "Timespan"), Category="Math|Timespan")
static FTimespan TimespanMinValue( ); /** Returns a zero time span value */
UFUNCTION(BlueprintPure, meta=(DisplayName="ZeroValue", ScriptConstant = "Zero", ScriptConstantHost = "Timespan"), Category="Math|Timespan")
static FTimespan TimespanZeroValue( ); UFUNCTION(BlueprintPure, Category="Math|Timespan", meta=(NativeMakeFunc))
static FTimespan MakeTimespan(int32 Days, int32 Hours, int32 Minutes, int32 Seconds, int32 Milliseconds); /** Makes a Timespan struct */
UFUNCTION(BlueprintPure, Category="Math|Timespan", meta=(NativeMakeFunc))
static FTimespan MakeTimespan2(int32 Days, int32 Hours, int32 Minutes, int32 Seconds, int32 FractionNano); /** Breaks a Timespan into its components */
UFUNCTION(BlueprintPure, Category="Math|Timespan", meta=(NativeBreakFunc))
static void BreakTimespan(FTimespan InTimespan, int32& Days, int32& Hours, int32& Minutes, int32& Seconds, int32& Milliseconds); /** Breaks a Timespan into its components */
UFUNCTION(BlueprintPure, Category="Math|Timespan", meta=(NativeBreakFunc))
static void BreakTimespan2(FTimespan InTimespan, int32& Days, int32& Hours, int32& Minutes, int32& Seconds, int32& FractionNano); /** Addition (A + B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Timespan + Timespan", CompactNodeTitle="+", Keywords="+ add plus"), Category="Math|Timespan")
static FTimespan Add_TimespanTimespan( FTimespan A, FTimespan B ); /** Subtraction (A - B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Timespan - Timespan", CompactNodeTitle="-", Keywords="- subtract minus"), Category="Math|Timespan")
static FTimespan Subtract_TimespanTimespan( FTimespan A, FTimespan B ); /** Scalar multiplication (A * s) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Timespan * float", CompactNodeTitle="*", Keywords="* multiply"), Category="Math|Timespan")
static FTimespan Multiply_TimespanFloat( FTimespan A, float Scalar ); /** Scalar division (A / s) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Timespan / float", CompactNodeTitle="/", Keywords="/ divide"), Category="Math|Timespan")
static FTimespan Divide_TimespanFloat( FTimespan A, float Scalar ); /** Returns true if the values are equal (A == B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Equal (Timespan)", CompactNodeTitle="==", Keywords="== equal"), Category="Math|Timespan")
static bool EqualEqual_TimespanTimespan( FTimespan A, FTimespan B ); /** Returns true if the values are not equal (A != B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Not Equal (Timespan)", CompactNodeTitle="!=", Keywords="!= not equal"), Category="Math|Timespan")
static bool NotEqual_TimespanTimespan( FTimespan A, FTimespan B ); /** Returns true if A is greater than B (A > B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Timespan > Timespan", CompactNodeTitle=">", Keywords="> greater"), Category="Math|Timespan")
static bool Greater_TimespanTimespan( FTimespan A, FTimespan B ); /** Returns true if A is greater than or equal to B (A >= B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Timespan >= Timespan", CompactNodeTitle=">=", Keywords=">= greater"), Category="Math|Timespan")
static bool GreaterEqual_TimespanTimespan( FTimespan A, FTimespan B ); /** Returns true if A is less than B (A < B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Timespan < Timespan", CompactNodeTitle="<", Keywords="< less"), Category="Math|Timespan")
static bool Less_TimespanTimespan( FTimespan A, FTimespan B ); /** Returns true if A is less than or equal to B (A <= B) */
UFUNCTION(BlueprintPure, meta=(DisplayName="Timespan <= Timespan", CompactNodeTitle="<=", Keywords="<= less"), Category="Math|Timespan")
static bool LessEqual_TimespanTimespan( FTimespan A, FTimespan B );

【UE4 C++】DateTime、Timespan 相关函数的更多相关文章

  1. 【UE4 C++】学习笔记汇总

    UE4 概念知识 基础概念--文件结构.类型.反射.编译.接口.垃圾回收.序列化[导图] GamePlay架构[导图] 类的继承层级关系[导图] 反射机制 垃圾回收机制/算法 序列化 Actor 的生 ...

  2. TimeSpan类【转】

    TimeSpan ts1 = new TimeSpan(DateTime.Now.Ticks); //获取当前时间的刻度数 //执行某操作 ............................ . ...

  3. 【2-26】string/math/datetime类的定义及其应用

    一string类 (1)字符串.Length    Length作用于求字符串的长度,返回一个int值 (2)字符串.TrimStart();  TrimStart():可删除前空格,返回一个stri ...

  4. C# 内置 DateTime类详解

    C# 内置 DateTime类详解 摘抄自微软官方文档,用来方便自己查阅:网址:https://msdn.microsoft.com/zh-cn/library/system.datetime(v=v ...

  5. C# 时间戳与DateTime互转

    #region 转换时间为unix时间戳 /// <summary> /// 转换时间为unix时间戳 /// </summary> /// <param name=&q ...

  6. TimeSpan 结构(struct)

    TimeSpan 是结构类型(struct),即值类型,可以通过两个DateTime(struct)之差来获得,如下例子: DateTime departure = new DateTime(2010 ...

  7. DateTime与long互转

    DateTime转long: public static long GetDateLong(object time) { DateTime epoc = TimeZone.CurrentTimeZon ...

  8. C#基础 类及常用函数【string 、Math 、DiteTime 、TimeSpan】

    一  string 类型 string str = "abcdefg"; str.Length  -  字符串长度,返回int类型 str.TrimStart()          ...

  9. C# 基础 - string 和 Datetime

    1. string 1. 格式化填充 string str = "this {0} a {1}"; Console.WriteLine(string.Format(str, &qu ...

随机推荐

  1. DorisDB升级为StarRocks,全面开源!

    今天被朋友圈刷屏了,StarRocks开源--携手未来,星辰大海! 原文链接:StarRocks开源--携手未来,星辰大海! 可能大家对StarRocks不太熟悉,但是DorisDB想必都是听说过的. ...

  2. Linux的LCD驱动分析及移植

    测试平台 宿主机平台:Ubuntu 12.04.4 LTS 目标机:Easy-ARM IMX283 目标机内核:Linux 2.6.35.3 LCD驱动分析 LCD屏的驱动总体上分成两块,一块是GUI ...

  3. Pytest系列(3) - setup和teardown的详细使用

    如果你还想从头学起Pytest,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1690628.html 前言 用过unittest的童鞋都 ...

  4. 苹果ASA广告投放归因的接入

    前段时间,苹果终于在大陆区开放了应用商店的竞价广告.毫无疑问又开启了苹果应用导量的新玩法,各大厂商都紧跟脚步吃螃蟹.本篇讲解苹果广告中的归因部分. 苹果广告其实在海外已运行多年,而因为IDFA的政策变 ...

  5. vscode快速添加引号 批量增加引号(用于批量格式化代码)

    一.在浏览器中将Params复制到pycharm的py文件中 二.选中需要添加引号的部分,Ctrl+H 调出替换工具栏 三.填写正则表达式 (.*?): (.*) '$1':'$2', 右侧注意点击使 ...

  6. PHP中的MySQLi扩展学习(六)MySQLI_result对象操作

    在之前的文章中,我们就已经接触过 MYSQLI_result 相关的内容.它的作用其实就是一个查询的结果集.不过在 PDO 中,一般直接通过 query() 或者 PDOStatement 对象进行查 ...

  7. PHP中的MySQLi扩展学习(一)MySQLi介绍

    关于 PDO 的学习我们告一段落,从这篇文章开始,我们继续学习另外一个 MySQL 扩展,也就是除了 PDO 之外的最核心的 MySQLi 扩展.可以说它的祖先,也就是 MySQL(原始) 扩展是我们 ...

  8. php_excel导出

    1.下载PHPExcel工具 2.解压后放置位置:ThinkPHP\Extend\Vendor\PHPExcel\PHPExcel.php. 3.Common.php代码 public functio ...

  9. PHPCMS V9轻松完成WAP手机网站搭建全教程

    ---恢复内容开始--- 应用PHPCMS V9轻松完成WAP手机网站搭建全教程 用PHPCMS最新发布的V9搭建了PHPCMS研究中心网站(http://www.17huiyi.net)完成后,有用 ...

  10. java中避免集合死链调用

    目录 1. 前言 2. 场景 3. 环境 3.1 开发环境准备 3.2 数据准备 3.2.1 Mysql数据库表及数据 3.2.2 redis库数据 4. 解决方式 5.完整代码 5.1Model 5 ...