问题标签 [python-dateutil]

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.

0 投票
1 回答
2657 浏览

python - datetime strftime 不输出正确的时间戳

以下:

显示时间应为 UTC 时间 2013 年 7 月 2 日凌晨 12 点。

然而:

1372744800 实际上是 Tue, 02 Jul 2013 06:00:00 UTC,这是错误的。很困惑。

0 投票
2 回答
2117 浏览

python - 使用python我如何按季度获取日期

使用 python、pandas 或 dateutil,我如何获得三个月期间的最后一个星期五,期间结束可能是 4 月。由于我的目标是“重点日期”,即每个月的最后一个星期五,提前三个月,我可能需要将提前期延长至六个月。

我试过 pandasBMonthEndBQuarterEndWeekOfMonth(weekday = 4, week =2)我不能滚动部分。

编辑:

0 投票
2 回答
380 浏览

python - 如何编辑现有规则?

我想编辑从字符串解析的现有规则以设置 UNTIL 日期。我怎样才能做到这一点?从理论上讲,我可以修改规则字符串并重新解析它,但是它变得复杂了。我想让它变得简单:无论规则说明了多少次出现或直到它到达什么日期,我都想用一个新的 UNTIL 日期覆盖它。

谢谢。

0 投票
2 回答
4171 浏览

python - “import babel.dates”让我的权限被拒绝

在 python 中,当我运行时,import babel.dates我得到一个权限被拒绝:

操作系统:

Python版本:

0 投票
1 回答
2205 浏览

python - 使 dateutil 解析器针对不明确的日期引发错误

dateutil.parser用于解析给定的字符串并将其转换为datetime.datetime对象。dayfirst它通过允许和yearfirst参数为某种格式提供先例来处理模棱两可的日期,例如“2-5-2013” ​​。

如果遇到不明确的日期,是否可以让解析器引发错误?我想它需要在第675 / 693 / 696行附近修改源代码( parser.py),但如果有一种方法不需要从字面上编辑源代码而只涉及重新定义某些函数,那就太好了也是。

当前行为:

期望的行为:

0 投票
1 回答
2233 浏览

python - 将 ASP.Net JSON 日期转换为 Python 日期时间

我得到的答复是时间格式,例如

我怎样才能将上述时间转换为格式

0 投票
2 回答
99884 浏览

python - ImportError:matplotlib 需要 dateutil

我已经在 x64 Windows7 上成功安装了带有 python 2.6 的 matplotlib。当我尝试导入 matplotlib 时,它显示以下错误。我还按照这个链接安装了 numpy:Installing Numpy on 64bit Windows 7 with Python 2.7.3

我怎样才能让它工作?

我从http://matplotlib.org/downloads.html安装了 matplotlib-1.3.0.win-amd64-py2.6.exe

0 投票
1 回答
1403 浏览

python - 在Python中将带有偏移量的奇数时间戳转换为UNIX时间

我有一个来自网络日志的时间戳字符串,如下所示:

2005 年 6 月 10 日:05:59:05 -0500

它喜欢将其转换为 UNIX 时间戳。

Adatetime可以转换为time.mktime(datetime.timetuple())

根据datetime文档datetime.strptime()应将其转换为日期时间:

至少在我的 Mac 上使用 Python 2.7.2,这会导致

ValueError:“z”是格式“%d/%b/%Y:%H:%M:%S %z”的错误指令

在阅读了有关该错误的许多问题后,我决定尝试python-dateutil

那也不起作用:

ValueError:未知的字符串格式

怎么办?

0 投票
1 回答
141 浏览

python - set up Darwin Calendar Server get an error about "MD5 sum for download file..."

When I set up Darwin Calendar Server, there is an error about download the dateutil:

I find the source code of calendar sever and find the code below(https://github.com/trevor/calendarserver/blob/master/support/build.sh): check_hash () { local file="$1"; shift;

Is there anybody know how to solve the problem? I could not find any useful page from google.

0 投票
1 回答
908 浏览

matplotlib - 无法安装 matplotlib 1.3 - 由于 dateutil 导致导入失败

在 Ubuntu 12.04 桌面上,我卸载了 matplotlib 1.1.1 并尝试通过 pip install matplotlib 安装 matplotlib 1.3。

一切似乎都奏效了,但现在当我尝试导入 matplotlib 时,我得到以下信息:

问题是,当我执行 pip freeze 时,我得到:

Dateutil 显然在那里。如果有人分享一些关于为什么会发生这种情况的信息,将不胜感激!