timezone

JavaScript, time zones, and daylight savings time

↘锁芯ラ 提交于 2019-12-18 06:13:09
问题 Welcome to this week's episode of Yet Another Time Zone Question : I've done a fair bit of reading on SO, tried to manipulate moment.js and date.js into helping me, and generally been plagued by a feeling of frustration since I started trying to solve this, so if someone could help or point me at the duplicate question on SO that I just haven't been able to find, that'd be awesome. I have a page. This page displays a series of times, e.g.: 7:28, 7:38, 7:48. I know whether these are AM/PM.

How to convert a Date String from UTC to Specific TimeZone in HIVE?

怎甘沉沦 提交于 2019-12-18 06:06:28
问题 My Hive table has a date column with UTC date strings. I want to get all rows for a specific EST date. I am trying to do something like the below: Select * from TableName T where TO_DATE(ConvertToESTTimeZone(T.date)) = "2014-01-12" I want to know if there is a function for ConvertToESTTimeZone, or how I can achieve that? I tried the following but it doesnt work (my default timezone is CST): TO_DATE(from_utc_timestamp(T.Date) = "2014-01-12" TO_DATE( from_utc_timestamp(to_utc_timestamp (unix

How do I get the visitor's current timezone then convert timezone.now() to string of the local time in Django 1.4?

一个人想着一个人 提交于 2019-12-18 05:59:06
问题 I understand that the best practice now with Django 1.4 is to store all datetime in UTC and I agree with that. I also understand that all timezone conversation should be done in the template level like this: {% load tz %} {% timezone "Europe/Paris" %} Paris time: {{ value }} {% endtimezone %} However, I need to convert the UTC time to the request 's local time all in Python. I can't use the template tags since I am returning the string in JSON using Ajax (more specifically Dajaxice).

jodatime how to know if daylight savings is on

不羁岁月 提交于 2019-12-18 05:44:21
问题 I have an API that needs the timezone. For eg. if I am in california, I need to pass -7 to it when daylight savings is on (California , PDT is GMT - 7) and -8 to it when daylight saving is off. But I am not able to figure out a way of knowing whether on the current date, daylight saving is on or off. Date date1 = new Date(); Calendar cal = Calendar.getInstance(); cal.setTime(date1); double[] coords = db.getCoords(id1); double latitude = coords[0]; double longitude = coords[1]; double timezone

How to refresh page on specific day at specific time in specific time zone?

时光怂恿深爱的人放手 提交于 2019-12-18 05:09:27
问题 I am developing a website that has two back to back web broadcasts. I have used PHP to display the time that the buttons should be enabled and disabled. Now I need to use Javascript to automatically refresh the page before the first broadcast, before the second broadcast and after the second broadcast. I implemented the following script and it does refresh the page at the given time, however, it doesn't work exactly as I need it to. I need to alter the script so that it refreshes the page on

Create a Timestamp without timeZone

大城市里の小女人 提交于 2019-12-18 04:53:23
问题 How can I create a java.sql.timestamp without timezone (i´m getting 2007-09-23T10:10:10Z and I pretend 2007-09-23T10:10:10 ). I try: Timestamp timestamp = Timestamp.valueOf("2007-09-23 10:10:10"); but in debug i saw that the cdate is 2007-09-23T10:10:10.000+0100 instead of 2007-09-23T10:10:10 回答1: A Timestamp doesn't have a timezone. When you display the timestamp as a String, it displays a time and mentions the timezone, because else you couldn't know what time it represents. And it chooses

NSDate expressed in different time zones, i.e. local time zone (GMT-400) to PST

耗尽温柔 提交于 2019-12-18 04:24:13
问题 I know how to use NSTimeZone to derive the offset for the current time in another time zone. NSDate always returns relative to GMT, so how do I derive a string with the proper time zone information? i.e. I take the current time where I am (in EST) and using NSTimeZone end up subtracting the 3 hours necessary to represent the time in PST. But all I've done is subtract 3 hours from the time which is still represented relative to my time zone. How do I get NSDateFormatter to spit out the time

How do I get a visitor's time zone in PHP?

 ̄綄美尐妖づ 提交于 2019-12-18 04:23:22
问题 Is there a way to find out visitors' timezone in PHP? 回答1: You can match user IP with GeoIP database end extract his region. Also check this API http://www.ipinfodb.com/ip_location_api.php 回答2: You can't do it alone with PHP as that information is not available. However, if you know the user's location you may be able to do some geo-locating and determine a probably timezone. You need javascript's help. I googled the following JS snippet which returns the client's timezone offset: var tzo=

Symfony2: Where to set a user defined time zone

吃可爱长大的小学妹 提交于 2019-12-18 03:46:56
问题 One of my requirements for my current project is to allow a user to choose a time zone for their account, and then use this time zone for all date/time related features throughout the entire site. The way I see it, I have two options: Pass in a DateTimeZone object to DateTime's constructor for every new DateTime Set the default time zone using PHP's date_default_timezone_set() It seems like using date_default_timezone_set is the way to go, but I'm not sure exactly where I should set it.

Java Quartz-Scheduler across TimeZone

情到浓时终转凉″ 提交于 2019-12-18 03:35:14
问题 My server runs on Europe/Rome timezone -and this one is the default tz on the server-, I need to schedule jobs according the user's timezone, so, if a user, living on Pacific/Honolulu timezone, schedules a CronTrigger that fires every day at 22:00pm for his region of the Earth I have found this solution: CronTrigger trigger = newTrigger() .withIdentity("name", "group") .withSchedule( cronSchedule("0 0 22 ? * *").inTimeZone(TimeZone.getTimeZone("Pacific/Honolulu")) ) .startNow() .build(); On