问题标签 [datetime-conversion]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - Java 中从 12 小时制到 24 小时制的时间转换
我在以下格式的字符串中有时间。
我需要以24:00
小时格式获取时间
前任:
我需要时间22:20
java - 从 unix 时间转换为日历 - 存在一小时不一致
我编写了这个方法来将 unix 时间转换为日历对象:
问题是,对于更大的输入值,我得到的实际时间与结果之间的差异正好是一小时。
差异从 796000000 值之间的某个地方开始......
例如,直到 796000000 我们得到相同的结果(与现实匹配),但对于 797000000 及以上,我们得到一小时的差异(我的代码在一小时前)。
如果我使用:
calendar.setTimeInMillis(unixTime*1000);
与现实相差 3-2 小时(相同的值),我遇到了同样的问题。
我使用了一些在线网站来检查自己,我正在寻找 GMT 0 的结果。 http://www.epochconverter.com/ http://www.onlineconversion.com/unix_time.htm
谢谢
ruby - 将秒参数传递到方法并存储在哪里?将秒转换为字符串 00:00:00
我收到错误:
运行以下规范
我的代码:
我得到了第一个初始化为 0 的测试,但我认为我做的不对。
此外,当我在终端 ruby 的 time_string 方法中运行代码时,它会返回正确的时间。但我只是不知道如何在 @timer.seconds = 0 或 ...seconds = 12 等时将其发回。
提前致谢!
java - 将时间字符串解析到日历时出错
我使用以下代码从值为09:10:06的字符串转换, 但在校准设置时间我得到了异常:无法解析的日期:“09:19:06”我该如何克服这个问题。
java - java中的时间转换
我有一个看起来像这样的代码:
它输出:Mon Jun 03 00:00:00 EDT 2013 Current Date Time : 2013-06-24 12:52:04
我想将第一行打印的第一个日期更改为第二行打印的第二个日期。我怎样才能做到这一点?提前致谢。
c# - 转换为 DateTime 时,字符串未被识别为有效的 DateTime
我正在尝试将字符串转换为 DateTime,然后将其插入 sql。在我的本地计算机上一切正常,但在服务器上,应用程序抛出异常:
我使用文本框来创建一个日期时间对象,如下所示:
我正在使用这条线来建立日期:
然后转换它
这是按钮单击后的代码:
然后我得到这个:
php - PHP - Converting Seconds to Minutes discrepancy
I'm running into a discrepancy with either my conversion of an integer into defined Minutes.
I figured I'd double check on some sites to see if the conversion is correct:
Here's one I found: http://www.thecalculatorsite.com/conversions/time.php
The result returned is: 4.4833333333333
Example 1 returns: 0:04:29 Example 2 returns: 4.4833333333333
I'm confused about this.
What am I missing here. Am I using the date()
function incorrectly?
c# - 无法从格式为 25-OCT-13 01.08.24.732000000 PM 的 excel 文件解析 asp.net 中的 DateTime
我正在阅读的 excel 文件具有 datetime 列值,"25-OCT-13 01.08.24.732000000 PM"
并将其读入我尝试过的 .Net 的 DateTime 格式
但它总是错误的。我错过了什么。
我在 Visual Studio 2013、.Net 4.5 中使用 C#
java - 除以 1e9d 是什么意思?
这是片段:
someTime
是通过使用导出的System.nanoTime()
。在这里做什么1e9d
?