计算时间和日期差异(Calculating Time and Date difference)
我目前正在编写一份报告来计算iReport中两个日期变量之间的
TotalTimeDifference
。我正在比较的两个变量是
MO_DATECREATED
和MO_DATECOMPLETED
并且我试图只计算时间差。我曾尝试设置一个变量,对两个变量进行简单的减法 - 当然,这根本没有奏效。
我会附上我目前拥有的照片,但我正在寻找比较两个变量(包含日期/时间)和打印出时间差异变量的方式。
例如:如果MO
started at 1/2/15 12:55pm
并completed at 1/3/15 1:55pm
我想打印时间差或花费多少时间为25 hours
我如何在iReport中做到这一点? 感谢您帮助新手!
编辑答案后,我想展示的日子:
I am currently writing a report to calculate the
TotalTimeDifference
between two date variables in iReport.The two variables that I am comparing are
MO_DATECREATED
andMO_DATECOMPLETED
and I am trying to calculate the time difference only.I have tried setting up a variable that does a simple subtraction of the two variables- and of course that has not worked at all.
I will attach photoes of what I currently have but I am looking for the way to compare the two variables (which contains date/time) and printing out a variables with the difference in time.
Example: If the MO was
started at 1/2/15 12:55pm
andcompleted at 1/3/15 1:55pm
i want to print the time difference, or how long it took, as25 hours
How can I do this in iReport? Thank you for helping out a newbie!
EDIT After answer, I would like to the show days to:
原文:https://stackoverflow.com/questions/34661493
满意答案
你可以这样做:
$(".user").click(function () { // Hide it but only if not hidden - hide $('.trigger:visible').hide(); // Later in the script - Show it but only If it's not visible. $('.trigger:hidden').show(); });
对于更多的上下文,在下列情况下元素被视为“隐藏”:
- 它们的CSS显示值为none。
- 它们是type =“hidden”的表单元素。
- 它们的宽度和高度显式设置为0。
- 或者祖先元素被隐藏,所以元素不会显示在页面上。
此外,“具有可见性的元素:隐藏或不透明度:0被认为是可见的。”
You can do this:
$(".user").click(function () { // Hide it but only if not hidden - hide $('.trigger:visible').hide(); // Later in the script - Show it but only If it's not visible. $('.trigger:hidden').show(); });
For some more context, elements are deemed ":hidden" if:
- They have a CSS display value of none.
- They are form elements with type="hidden".
- Their width and height are explicitly set to 0.
- Or an ancestor element is hidden, so the element is not shown on the page.
Additionally, "elements with visibility: hidden or opacity: 0 are considered to be visible."
相关问答
更多jQuery:在可见时自动隐藏通知(jQuery: Auto-hide notification when it's visible)
jQuery是(':visible')是(':hidden')没有按预期工作(jQuery is(':visible') is(':hidden') not working as expected)
为什么jQuery显示/隐藏使用display:none而不是visibility:hidden?(Why does jQuery show/hide use display:none instead of visibility:hidden?)
jquery在没有硬编码的情况下显示/隐藏div中的内容(jquery show/hide content in div without hardcoding)
jQuery显示隐藏的li元素,但随后隐藏了可见的li元素(jQuery show hidden li elements, but then hide visible li elements)
默认情况下隐藏叠加层时,jquery库不可见(jquery gallery not visible when overlay is hidden by default)
jQuery:手风琴 - 如果隐藏,显示,否则隐藏?(jQuery: Accordion - if hidden, show, else hide?)
只有在可见的情况下,jQuery才会隐藏,仅在隐藏时才显示[closed](jQuery hide only if visible, show only if hidden [closed])
jQuery - 只隐藏那些可见的(jQuery - Hiding only those that are visible)
Jquery显示/隐藏修复[关闭](Jquery show / hide fix [closed])
相关文章
更多The Log: What every software engineer should know about real-time data's unifying abstraction
Real-Time Rendering 笔记 --- 1-4章
Java日期时间
在java.util.Date中,如何比较两个Date的大小,精确到分
用SimpleDateFormat把字符串转换成Date的时候报NumberFormatException
display控件格式化时间日期的问题?
日期和时间的国际化
JFreeChart笔记 (十) 时间序列图:差异对比图
Javascript取当前日期、时间、星期的代码
java计算某天与今天相差的天数
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!