timezone

C# Synchronizing different time zones

荒凉一梦 提交于 2020-01-05 05:28:12
问题 I have an application on a server which is UK based. Say I needed the application to run at the same time for different countries. For arguments sake say I needed it to send an email to a mailbox whenever the time is 7pm in various countries. How would I be able to achieve this? At the moment I just have it running from the Task Scheduler at the specific time (which is fine for UK based clients). However, I would like to support internationally. Thanks. 回答1: Store date/times as UTC, and then

RedBeanPHP - R::isoDateTime() - How to set timezone?

回眸只為那壹抹淺笑 提交于 2020-01-05 04:19:07
问题 There is a convenience function in RedBeanPHP ORM for ceating dates. $time = R::isoDateTime(); How can I set a time zone? The default function does not return the time of the machine on which RB is running on. 回答1: It appears from reading the source code, that R::isoDateTime() is just a convenience method. It simply calls the PHP time() function, then formats the result as a string using the date function. I didn't test it, but in theory - the date_default_timezone_set function should work.

Missing Microsoft time zones

我只是一个虾纸丫 提交于 2020-01-05 03:57:06
问题 I'm looking at using the Microsoft time zones (by utilising the System.TimeZoneInfo class in C#) to convert stored UTC dates to local timezone dates and vice versa. However, I've noticed that this isn't a comprehensive list. For example, it currently only has one timezone defined for Greenland ( Greenland Standard Time (GMT-03:00) Greenland ), where wikipedia and timeanddate both show there are 2 major time zones in use (eastern and western) as well as 2 lesser used ones. Is there a

mapping joda timezone to windows timezone (for example in C#)

本小妞迷上赌 提交于 2020-01-05 02:51:07
问题 I'm having trouble mapping joda time zones to windows time zones. I use the xml of CLDR mappings, and it works for most of the translations. nevertheless, it doesn't have values for several joda time zones: America/Indiana/Indianapolis, BST, Australia/Victoria, Universal, Australia/NSW, America/Fort_Wayne, Africa/Asmara, America/Kentucky/Louisville, Asia/Kashgar, US/Pacific, Australia/West, Australia/Queensland, Australia/South, US/Eastern, US/Central, US/Arizona, Australia/Tasmania, NZ, US

Issue validating user time zone for Rails app on Heroku

删除回忆录丶 提交于 2020-01-05 02:43:08
问题 I'm following Ryan Bates' tutorial on adding time zones to a rails app. http://railscasts.com/episodes/106-time-zones-revised (It's a good tutorial, by the way) Anyway, Ryan says it's a good idea to validate the submitted time zone with the ones that Rails knows about. He put this rule into the users' model: validates_inclusion_of :time_zone, in: ActiveSupport::TimeZone.zones_map(&:name) That works fine in development. However, when I run the app on Heroku, it does not like the timezone

Difference between datetime.combine() and pytz.localize()

穿精又带淫゛_ 提交于 2020-01-05 02:35:09
问题 I am a bit puzzled by the following behavior. Suppose I use datetime.combine() to construct a timezone-aware object: >>> date datetime.date(2018, 10, 17) >>> time datetime.time(6, 0) >>> tz <DstTzInfo 'Europe/Berlin' LMT+0:53:00 STD> >>> datetime.combine(date, time, tzinfo=tz) datetime.datetime(2018, 10, 17, 6, 0, tzinfo=<DstTzInfo 'Europe/Berlin' LMT+0:53:00 STD>) or I use pytz.localize() to do the same: >>> tz.localize(datetime.combine(date, time)) datetime.datetime(2018, 10, 17, 6, 0,

Format date with timezone in angularjs

对着背影说爱祢 提交于 2020-01-05 01:43:12
问题 Using angularjs 1.2.26 i cant format my date input to the desired timezone, here's an example: http://plnkr.co/edit/CxCqoR3Awcl1NFrCZYjx?p=preview {{'2015-07-10T12:37:08Z' | date : "MMMM d, y 'at' h:mma Z" : 'America/Bahia'}} and {{'2015-07-10T12:37:08Z' | date : "MMMM d, y 'at' h:mma Z" : 'Europe/Paris'}} gave the same output respecting my browser's local timezone and ignoring the timezone i've set. 回答1: There are two problems: The time zone support looks like it was introduced post-1.2.26

SimpleDateFormat fails to format Date interval?

我只是一个虾纸丫 提交于 2020-01-04 13:46:13
问题 I try to format a time interval using SimpleDateFormat. import java.text.*; import java.util.*; public class DateFormatTest { public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss"); long interval = 1000; System.out.println("Interval in millis: " + interval); System.out.println("Expected result: 00:00:01"); System.out.println("Result using Date and SimpleDateFormat: " + sdf.format(new Date(interval))); } } I get the following result: Interval in millis

TimeZone Not Found Exception [duplicate]

痞子三分冷 提交于 2020-01-04 13:37:09
问题 This question already has answers here : TimeZoneInfo.FindSystemTimeZoneById() throws exception in a Unity application (2 answers) Closed 3 years ago . I want to convert Indian DateTime object to Eastern DateTime object. Means I want to change time zone of particular DateTime object. For this I have written following code: string easternZoneId = "Eastern Standard Time"; TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById(easternZoneId); string indianZoneId = "India Standard Time";

TimeZone Not Found Exception [duplicate]

假装没事ソ 提交于 2020-01-04 13:36:57
问题 This question already has answers here : TimeZoneInfo.FindSystemTimeZoneById() throws exception in a Unity application (2 answers) Closed 3 years ago . I want to convert Indian DateTime object to Eastern DateTime object. Means I want to change time zone of particular DateTime object. For this I have written following code: string easternZoneId = "Eastern Standard Time"; TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById(easternZoneId); string indianZoneId = "India Standard Time";