timezone

time zones in POSIXct and xts, converting from GMT in R

心已入冬 提交于 2020-01-12 21:25:10
问题 I have a bunch of 1 minute returns in an xts object with the index being POSIXct and time zone being GMT. The returns are on NYSE so I would like to convert to the eastern time zone but I would like to take care of the daylight savings time properly. What is the best way of doing this? I am a bit confused between the EST timezone and the EDT timezone. I would like my times to convert properly to the NY time in winter and summer. 回答1: Use indexTZ<- and the America/New_York timezone > tail(SPY)

how do you deal with timezone issues? [duplicate]

限于喜欢 提交于 2020-01-12 15:16:28
问题 This question already has an answer here : How to store repeating dates keeping in mind Daylight Savings Time (1 answer) Closed 2 years ago . For a scheduling system, what's the best way to save the timezone of client/event in a central server database coming from multiple sources mobile,web,client app. How do you store the dates? Alarms, reminders etc... How do you handle the DST setting? How do you handle the events if client has traveled to a different location? I need the solution to work

PHP, Codeigniter: How to Set Date/Time based on users timezone/location globally in a web app?

淺唱寂寞╮ 提交于 2020-01-12 14:15:50
问题 I have just realised if I add a particular record to my MySQL database - it will have a date/time of the server and not the particular user and where they are located which means my search function by date is useless! As they will not be able to search by when they have added it in their timezone rather when it was added in the servers timezone. Is there a way in Codeigniter to globally set time and date specific to a users location (maybe using their IP) and every time I call date() or time(

PHP, Codeigniter: How to Set Date/Time based on users timezone/location globally in a web app?

余生长醉 提交于 2020-01-12 14:15:43
问题 I have just realised if I add a particular record to my MySQL database - it will have a date/time of the server and not the particular user and where they are located which means my search function by date is useless! As they will not be able to search by when they have added it in their timezone rather when it was added in the servers timezone. Is there a way in Codeigniter to globally set time and date specific to a users location (maybe using their IP) and every time I call date() or time(

What is best practice for timezone handling in MySQL?

大憨熊 提交于 2020-01-12 08:01:08
问题 This has been asked before but not the answer I am looking for. I am storing all my dates in MYSQL in UTC/GMT. When I extract data fora user that references time is it better to use the CONVERT_TZ construct... SELECT CONVERT_TZ(mytime,'UTC',usertimezone) as mytime FROM table or is it better to temporarily set the session zone in Mysql and then do normal queries? SET time_zone = usertimezone; And if I use the second, do I just do that once for each user session or if I am not using a

Get current date time from server and convert it into local time in c#

前提是你 提交于 2020-01-12 08:00:10
问题 Help: I have a server which is having time in GMT-07.00 hours. My local time is GMT+05.30 hours. I need to get current date and time from server and convert this date and time into my local time. I have tried many codes, but still have not found a successive way of doing this. Can somebody please help me out. string zoneId = "India Standard Time"; TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(zoneId); DateTime result = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, tzi); DateTime

Convert ZonedDateTime to LocalDateTime at time zone

爱⌒轻易说出口 提交于 2020-01-12 06:44:26
问题 I have an object of ZonedDateTime that is constructed like this ZonedDateTime z = ZonedDateTime.of(LocalDate.now().atTime(11, 30), ZoneOffset.UTC); How can I convert it to LocalDateTime at time zone of Switzerland? Expected result should be 16 april 2018 13:30 . 回答1: How can I convert it to LocalDateTime at time zone of Switzerland? You can convert the UTC ZonedDateTime into a ZonedDateTime with the time zone of Switzerland, but maintaining the same instant in time, and then get the

Convert ZonedDateTime to LocalDateTime at time zone

狂风中的少年 提交于 2020-01-12 06:44:10
问题 I have an object of ZonedDateTime that is constructed like this ZonedDateTime z = ZonedDateTime.of(LocalDate.now().atTime(11, 30), ZoneOffset.UTC); How can I convert it to LocalDateTime at time zone of Switzerland? Expected result should be 16 april 2018 13:30 . 回答1: How can I convert it to LocalDateTime at time zone of Switzerland? You can convert the UTC ZonedDateTime into a ZonedDateTime with the time zone of Switzerland, but maintaining the same instant in time, and then get the

Rails: get #beginning_of_day in time zone

☆樱花仙子☆ 提交于 2020-01-12 03:13:05
问题 I have a default time zone setup for the rails application. And an instance of the Date object. How can I get make Date#beginning_of_day to return the beginning of the day in the specified time zone, but not my local timezone. Is there any other method to get beginning of the day time in the specified timezone for the given date? date = Date.new(2014,10,29) zone = ActiveSupport::TimeZone.new('CET') date.foo(zone) # should return "Wed, 29 Oct 2014 00:00:00 CET +01:00" zone = ActiveSupport:

Rails: get #beginning_of_day in time zone

风流意气都作罢 提交于 2020-01-12 03:11:14
问题 I have a default time zone setup for the rails application. And an instance of the Date object. How can I get make Date#beginning_of_day to return the beginning of the day in the specified time zone, but not my local timezone. Is there any other method to get beginning of the day time in the specified timezone for the given date? date = Date.new(2014,10,29) zone = ActiveSupport::TimeZone.new('CET') date.foo(zone) # should return "Wed, 29 Oct 2014 00:00:00 CET +01:00" zone = ActiveSupport: