Skip to content

Instantly share code, notes, and snippets.

@kn1kn1
Created December 12, 2022 09:27
Show Gist options
  • Save kn1kn1/5575547653d227fa1ee3051777012b15 to your computer and use it in GitHub Desktop.
Save kn1kn1/5575547653d227fa1ee3051777012b15 to your computer and use it in GitHub Desktop.
r_tz.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyMWr5CUcz+qFFiPEU5JqAbq",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/kn1kn1/5575547653d227fa1ee3051777012b15/r_tz.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"id": "IYQ-sZtOfVjj"
},
"outputs": [],
"source": [
"%load_ext rpy2.ipython"
]
},
{
"cell_type": "code",
"source": [
"!pip install rpy2==3.5.1"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "hpYBA52EhCRQ",
"outputId": "250d3592-d41b-41a6-b543-6219346747e7"
},
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: rpy2==3.5.1 in /usr/local/lib/python3.8/dist-packages (3.5.1)\n",
"Requirement already satisfied: cffi>=1.10.0 in /usr/local/lib/python3.8/dist-packages (from rpy2==3.5.1) (1.15.1)\n",
"Requirement already satisfied: jinja2 in /usr/local/lib/python3.8/dist-packages (from rpy2==3.5.1) (2.11.3)\n",
"Requirement already satisfied: pytz in /usr/local/lib/python3.8/dist-packages (from rpy2==3.5.1) (2022.6)\n",
"Requirement already satisfied: tzlocal in /usr/local/lib/python3.8/dist-packages (from rpy2==3.5.1) (1.5.1)\n",
"Requirement already satisfied: pycparser in /usr/local/lib/python3.8/dist-packages (from cffi>=1.10.0->rpy2==3.5.1) (2.21)\n",
"Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.8/dist-packages (from jinja2->rpy2==3.5.1) (2.0.1)\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"%%R\n",
"Sys.getenv('TZ')"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "NWSuzoc6foNk",
"outputId": "04c89ca4-0cf3-4f1a-b3ad-73de3ac3471c"
},
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1] \"\"\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"%%R\n",
"Sys.timezone()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "sioW8GN9ppWf",
"outputId": "de84bc3d-2367-4b46-d03b-1a17d9f22ff7"
},
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1] \"Etc/UTC\"\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"%%R\n",
"as.POSIXct(\"2011-03-20 12:34:56\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "rcE36b6Qf5Vo",
"outputId": "9b6a6e13-7e20-4f3f-f93f-31ceff01ac39"
},
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1] \"2011-03-20 12:34:56 UTC\"\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!ls -l /etc/localtime"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "_l3BigP4hb5Y",
"outputId": "83275d60-f471-406b-ed5b-22b44b09c728"
},
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"lrwxrwxrwx 1 root root 27 Dec 8 14:25 /etc/localtime -> /usr/share/zoneinfo/Etc/UTC\n"
]
}
]
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "j-c6OxLMniMG"
},
"execution_count": 6,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment