paystub问题,datediff(vb.net) [英] paystub problem, datediff (vb.net)
本文介绍了paystub问题,datediff(vb.net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在努力解决这个paystub程序问题。所以控制台应该询问开始时间和结束时间,然后用给定的费率计算工资。
我如何输入开始和结束时间作为时间而不是双倍。
i将它们作为日期变暗然后我不知道如何找到时间两次之间的差异。我应该使用约会吗?如果是这样,约会工作如何导致我似乎无法使约会工作。
非常感谢
hi i am having trouble with this paystub program i am working on. so the console is supposed to ask for the start time and end time then calculate the pay with the rate given.
How can i enter the start and end times as time and not a double.
i dimmed them as date but then i dont know how to find the time difference between the two times. am i supposed to use datediff? and if so how does datediff work cause i cant seem to get datediff to work.
thanks a lot
推荐答案
如何你在日期/时间阅读吗?
它们可能以字符串形式出现?
用它来创建/填充DateTime对象。
然后在它们上使用运算符来生成TimeSpan对象。
您应该能够使用TimeSpan对象
How are you reading in the date/times?
They probably come in as a string?
Use it to create/populate DateTime objects.
Then use operators on them to produce a TimeSpan object.
you should be able to do what you need with a TimeSpan object
我只能使用像10这样的时间: 35点到下午4点半,然后我想要一个能够找到两小时之间差异的功能。 timepan这样做是因为我之前从未使用过它。
im only using times like 10:35 am till 4:30 pm, then i want a function that would be able to find the difference between the two times in hours. does timespan do this because i have never used it before.
Yup。创建DateTime对象,然后从另一个中减去一个并将其转换为TimeSpan对象。
Yup. Create your DateTime objects and then subtract one from the other and cast it to a TimeSpan object.
这篇关于paystub问题,datediff(vb.net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文