我看到了很多关于如何从一个datetime中减去另一个datetime以及如何将年份添加到datetime中的信息。但是下面的内容让我头疼。如何在powerbuilder中从日期中减去1分钟?请帮助和支持。
感谢并致以Rahul G
发布于 2017-03-09 22:48:33
如果你使用的是powerbuilder.net,你可以用两行代码来完成:
System.DateTime newDate
newDate = System.DateTime.Now.AddMinutes(-1);发布于 2014-09-22 18:01:03
这就是在PowerScript中是如何完成的。如果您在SQL中使用DateAdd函数执行此操作,则会更容易。
DateTime ldt_thedate,ldt_newdate
时间lt_thetime
//获取当前的date-time
ldt_thedate = DateTime(Today(),Now())
//减去1分钟
lt_thetime =RelativeTime(时间(Ldt_thedate),-1)
//组装date-time
ldt_newdate = DateTime(Date(ldt_thedate),lt_thetime)
https://stackoverflow.com/questions/25967575
复制相似问题