New unified DateTime type in Dynamics Ax 5.0

Dynamics Ax 5.0 引入了新的 UtcDateTime 数据类型,统一了日期与时间的处理方式,使其更接近 SQL 的处理方法。微软还对时间戳字段进行了重命名,并新增了对应的统一字段。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

New unified DateTime type in Dynamics Ax 5.0
 
Good afternoon,

Anyone that has experience with SQL has noticed that DAX versions prior to 5.0 handle date and time differently from SQL. Whereas SQL uses a single field to hold both date and time, DAX uses separate datatypes and fields for the two. That is no longer the case in version 5.0x as a new UtcDateTime datatype has been introduced. Microsoft has also renamed all timestamp fields to DEL_* (such as CreatedDate and CreateTime) and added corresponding unified fields (such as createdDateTime).

Note that the original datatypes Date and Time are still available for use when only a time or a date is needed.

Here's a quick job as example of tools available on the new datatype:

static void UtcDateTimeExamples(Args _args)
{
    UtcDateTime utcDateTimeNow = DateTimeUtil::getSystemDateTime();
    ;

    info(strfmt("%1", utcDateTimeNow));
    info(strfmt("%1", DateTimeUtil::date(utcDateTimeNow)));
    info(strfmt("%1", DateTimeUtil::time(utcDateTimeNow)));
    info(strfmt("%1",
        DateTimeUtil::applyTimeZoneOffset(utcDateTimeNow,DateTimeUtil::getUserPreferredTimeZone())));
    info(strfmt("%1", DateTimeUtil::utcNow()));
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值