{
  "id": 66550,
  "title": "date vs visitStartTime",
  "url": "/competitions/ga-customer-revenue-prediction/discussion/66550",
  "author_name": "",
  "post_date": "2018-09-22T16:09:16.095203Z",
  "votes": 2,
  "comment_count": 4,
  "views": 0,
  "content": "<p>In R, <strong>date</strong> when parsed by lubridate and <strong>visitStartTime</strong> parsed by as_datetime, give different results (as in different dates) even though the timezone is the same</p>\n\n<pre><code># Dataset loaded in test\n# Example fullVisitorId = 377306020877927872,  visitId = 1472880147\nlibrary(lubridate)\ntest$date &lt;- ymd(test$date) \n### Result = 2016-09-02\ntest$visitStartTime &lt;- as_datetime(test$visitStartTime)\n### Result = 2016-09-03 05:22:27\ntz(test$date)\n### Result = \"UTC\"\ntz(test$visitStartTime)\n### Result = \"UTC\"\n</code></pre>\n\n<p>Any help would be highly appreciated</p>",
  "messages": [
    {
      "id": "391868",
      "postDate": "09/22/2018 16:09:16",
      "content": "<p>In R, <strong>date</strong> when parsed by lubridate and <strong>visitStartTime</strong> parsed by as_datetime, give different results (as in different dates) even though the timezone is the same</p>\n\n<pre><code># Dataset loaded in test\n# Example fullVisitorId = 377306020877927872,  visitId = 1472880147\nlibrary(lubridate)\ntest$date &lt;- ymd(test$date) \n### Result = 2016-09-02\ntest$visitStartTime &lt;- as_datetime(test$visitStartTime)\n### Result = 2016-09-03 05:22:27\ntz(test$date)\n### Result = \"UTC\"\ntz(test$visitStartTime)\n### Result = \"UTC\"\n</code></pre>\n\n<p>Any help would be highly appreciated</p>",
      "rawMarkdown": "In R, **date** when parsed by lubridate and **visitStartTime** parsed by as_datetime, give different results (as in different dates) even though the timezone is the same\n\n    # Dataset loaded in test\n    # Example fullVisitorId = 377306020877927872,  visitId = 1472880147\n    library(lubridate)\n    test$date &lt;- ymd(test$date) \n    ### Result = 2016-09-02\n    test$visitStartTime &lt;- as_datetime(test$visitStartTime)\n    ### Result = 2016-09-03 05:22:27\n    tz(test$date)\n    ### Result = \"UTC\"\n    tz(test$visitStartTime)\n    ### Result = \"UTC\"\n\nAny help would be highly appreciated",
      "votes": null
    },
    {
      "id": "391909",
      "postDate": "09/22/2018 17:21:07",
      "content": "<p>It is a good observation. My suggestion would be to just use it in your models if helps.</p>",
      "rawMarkdown": "It is a good observation. My suggestion would be to just use it in your models if helps.",
      "votes": null
    },
    {
      "id": "391969",
      "postDate": "09/22/2018 19:21:10",
      "content": "<p>See discussion in <a href=\"https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/65691#387171\">https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/65691#387171</a></p>",
      "rawMarkdown": "See discussion in https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/65691#387171",
      "votes": null
    },
    {
      "id": "391977",
      "postDate": "09/22/2018 19:36:04",
      "content": "<p>Thanks Misha, I think I will try and use some combination of location to sort out the timezone</p>",
      "rawMarkdown": "Thanks Misha, I think I will try and use some combination of location to sort out the timezone",
      "votes": null
    },
    {
      "id": "393677",
      "postDate": "09/25/2018 18:38:38",
      "content": "<p>Since this is discussed in several threads, I posted the explanation <a href=\"https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/66815\">here</a>.\nI believe this will make it clear.</p>",
      "rawMarkdown": "Since this is discussed in several threads, I posted the explanation [here](https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/66815).\nI believe this will make it clear.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 391909,
      "author_name": "abosol",
      "author_url": "",
      "post_date": "09/22/2018 17:21:07",
      "content": "<p>It is a good observation. My suggestion would be to just use it in your models if helps.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 391969,
      "author_name": "mlisovyi",
      "author_url": "",
      "post_date": "09/22/2018 19:21:10",
      "content": "<p>See discussion in <a href=\"https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/65691#387171\">https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/65691#387171</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 391977,
          "author_name": "pratnimk",
          "author_url": "",
          "post_date": "09/22/2018 19:36:04",
          "content": "<p>Thanks Misha, I think I will try and use some combination of location to sort out the timezone</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 393677,
      "author_name": "yannisp",
      "author_url": "",
      "post_date": "09/25/2018 18:38:38",
      "content": "<p>Since this is discussed in several threads, I posted the explanation <a href=\"https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/66815\">here</a>.\nI believe this will make it clear.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "391868": "In R, **date** when parsed by lubridate and **visitStartTime** parsed by as_datetime, give different results (as in different dates) even though the timezone is the same\n\n    # Dataset loaded in test\n    # Example fullVisitorId = 377306020877927872,  visitId = 1472880147\n    library(lubridate)\n    test$date &lt;- ymd(test$date) \n    ### Result = 2016-09-02\n    test$visitStartTime &lt;- as_datetime(test$visitStartTime)\n    ### Result = 2016-09-03 05:22:27\n    tz(test$date)\n    ### Result = \"UTC\"\n    tz(test$visitStartTime)\n    ### Result = \"UTC\"\n\nAny help would be highly appreciated",
    "391909": "It is a good observation. My suggestion would be to just use it in your models if helps.",
    "391969": "See discussion in https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/65691#387171",
    "391977": "Thanks Misha, I think I will try and use some combination of location to sort out the timezone",
    "393677": "Since this is discussed in several threads, I posted the explanation [here](https://www.kaggle.com/c/ga-customer-revenue-prediction/discussion/66815).\nI believe this will make it clear."
  },
  "source": "meta"
}