NX open中获取系统日期

利用UF函数获取系统的日期和时间:

UF_system_info_t info;

UF_system_info_t info; 

设置一个string类型的变量获取时间,在创建一个char类型的数组将string中系统时间变为日期:

string formatdata = info.date_buf;
char msg[256];
sprintf(msg,"%s-%s-%s",formatdata.substr(0,4),formatdata.substr(5,2),formatdata.substr(8,2));

最后设置日期,将得到的系统日期和自己设置的ui建立联系:

PropertyList *blockriqitProps = string02->GetProperties();
blockriqitProps -> SetString("Value",msg);
delete blockriqitProps;
blockriqitProps = NULL;

释放获取的系统时间所占的内存:

  UF_free_system_info(&info);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值