timezone

Convert date string that contains time zone to POSIXct in R

蹲街弑〆低调 提交于 2019-12-12 03:24:47
问题 I have a vector with dates in this format (example of the first 6 rows): Dates<-c( "Sun Oct 04 20:33:05 EEST 2015", "Sun Oct 04 20:49:23 EEST 2015", "Sun Oct 04 21:05:25 EEST 2015", "Mon Sep 28 10:02:38 IDT 2015", "Mon Sep 28 10:17:50 IDT 2015", "Mon Sep 28 10:39:48 IDT 2015") I tried to read this variable Dates to R using as.Date() function: as.Date(Dates,format = "%a %b %d %H:%M:%S %Z %Y") but the process failed as %Z parameter is not supported in the input. The time zones differ throughout

Get Timezone Offset From City and State/Province or Zip

谁说我不能喝 提交于 2019-12-12 03:22:51
问题 I have an asp.net website that will be hosted on a server using EST time and will likely be made on a computer/device operating in EST. The user will be making updates to information pertaining to locations all over North America. I need the timestamp of the update to be made in the local time of the location that the update is being made to, not server or computer time. So I need to be able to get the offset for a location based on either City and State/Province or the Zip code. I've already

Turkey Continues on Daylight Saving Time From 2016 - Impact on Postgresql

こ雲淡風輕ζ 提交于 2019-12-12 03:09:52
问题 what is impact on Postgresql databases? Jobs ,date columns datas will be affected? 回答1: postgresql uses the zoneinfo database for time zone computations. The database's 2016g version which was released 2 weeks ago, includes an update to handle the situation for Turkey correctly. For now, you'll have to wait for the postgresql developers to pull the latest version of zoneinfo into postgresql and then release a new version. You can check what postgres thinks for Turkey's timezone as follows: $

Why changing timezone from shell does not affect gettimeofday() even after reboot?

空扰寡人 提交于 2019-12-12 03:06:58
问题 I have changed on Ubuntu timezone using dpkg-reconfigure tzdata from UTC+2 to UTC+0 but running C code gettimeofday() still showing tz_minuteswest and tv_sec in previous timezone even after reboot. Only after running C code below once gettimeofday() starts to showing UTC+0 time: #include <stdlib.h> #include <stdio.h> #include <sys/time.h> int main() { struct timeval tv; struct timezone tz; setenv("TZ", "UTC", 1); tzset(); gettimeofday(&tv, &tz); tv.tv_sec -= 7200; tz.tz_minuteswest = 0;

How to show the time and date saved in my database to the user according to their local timezone? Please see details

前提是你 提交于 2019-12-12 03:02:25
问题 I'm developing an app in which I'm saving the date and time in Firebase and then retrieving it for the user to see. What I want is I want user to see that time and date according to their local timezone. for ex - if the time and date saved in database is '2:07 PM' and 'Fri, Jun 24', then to the users in PST timezone, it should be shown as '1:37 AM' and 'Fri, Jun 24'. Here's how I'm getting time and date: DateFormat currentTime = new SimpleDateFormat("h:mm a"); final String time = currentTime

Calling `new Date(long)` results in “Jan 01 01:00:00 CET 1970”? [duplicate]

回眸只為那壹抹淺笑 提交于 2019-12-12 02:57:16
问题 This question already has answers here : Epoch is not epoch if do a new Date(0L). Why? (4 answers) Closed last year . The Java doc describe that the constructor Date(long date) constructs a Date object using the given milliseconds time value since January 1, 1970, 00:00:00 GMT When I did new Date(0) , the date is Jan 01 01:00:00 CET 1970 I don't know why it begin with 01h 回答1: It's show 1AM because you're an hour ahead of GMT. A date instance is simply a counter of the number of milliseconds

Setting timezone offset in PHP

爷,独闯天下 提交于 2019-12-12 02:55:37
问题 I'm writing an API that will retrieve readings from a sensor and return a list of times and values, offset using Javascript's `new Date(). (see below for the reason) I've been able to get the time addition / subtraction working well enough, using $date->sub(DateInterval::createFromDateString($offset . " minutes")) , but the time and date returned have an offset of +00:00 (e.g. 2016-02-26T13:32:28+00:00 instead of 2016-02-26T13:32:28+11:00 for Australia). This causes issues for things like the

assistance with a timestamp php function

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:47:44
问题 I need to convert a timestamp to UTC-5 The $offset is the user's timezone the values are from -12 to 12. $ds is daylight savings, if it's on, it will add an extra hour. I made this function, but I think it converts a UTC-5 timestamp to a new timestamp based on the user's timezone...I need the function to be inverted so that it returns a timestamp in UTC-5 instead. Of course the problem is much larger than this, but here's where I'm stuck. Any way to go about it? function input_date($timestamp

.ToUniversalTime() Is Incorrect?

我怕爱的太早我们不能终老 提交于 2019-12-12 02:46:13
问题 DateTime dt = new DateTime(1972, 4, 24, 0, 0, 0); Response.Write("dt: " + dt.ToString("M/d/yyyy h:mm:ss tt") + "<br />"); Response.Write("dt.Kind: " + dt.Kind.ToString() + "<br />"); Response.Write("dt.ToUniversalTime(): " + dt.ToUniversalTime().ToString("M/d/yyyy h:mm:ss tt") + "<br />"); displays dt: 4/24/1972 12:00:00 AM dt.Kind: Unspecified dt.ToUniversalTime(): 4/24/1972 7:00:00 AM which is incorrect. April 24, 1972 at 12 PM Pacific is actually April 24, 1972 at 8 AM UTC. I have

to compare Indian time

巧了我就是萌 提交于 2019-12-12 02:42:40
问题 I want to find out what will be the time in india when clock tick to 1Am mid night in any other country.. How i will find out that through any means plz help me to find out this this is to fire birthbay mails at 1AM midnight of that resp country... 回答1: SQL SERVER 2008 would have the DATETIMEOFFSET data type (which includes the time zone) plus functions like SWITCHOFFSET to switch from one timezone offset to another. What version are you on? 回答2: .NET 3.5 added the class TimeZoneInfo which