python - 设置时区后 Google Colab 日期错误
问题描述
我一直在尝试设置 google colab 以使用今天从美国/东部时间设置的日期(我在美国西海岸,太平洋标准时间,这是一个额外的皱纹),这在东部时间晚上 7 点之后失败。我已经尝试了下面的代码,并在 2021 年 2 月 19 日返回 2021 年 2 月 20 日太平洋标准时间晚上 7 点(美国东部时间晚上 10 点)。
!rm /etc/localtime
!ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
!date
dateofinterest = datetime.date.today()
print(dateofinterest)
关于如何让我的 colab 实例进入特定时区的任何想法或想法?
解决方案
推荐阅读
- c++ - 具有自定义破坏功能的线程包装器
- php - 通过 routes/web.php 从供应商处获取路由
- javascript - 有没有一种方法可以在 Vue.js 中制作一个由两个链接字符串组成的道具?
- c++ - C ++中数组索引的奇怪类型分配
- sql-server - 如何在 SQL Server 的同一根目录中添加其他属性和 XML 命名空间值
- python - 用平均值绘制指数
- javascript - PHP Loop 只在 js 中取出它的最后一个值
- php - Facebook SDK 返回错误:跨站请求伪造验证失败。持久数据中缺少必需的参数“状态”
- sql - 计算正常和夜班的工作时间
- javascript - 导入脚本获取自身的 URL/路径?