Search Results

Search found 119 results on 5 pages for 'timezones'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Missing time zones in OSX and Windows

    - by pellepim
    I am working on a javascript to automatically detect a user's timezone (https://bitbucket.org/pellepim/jstimezonedetect/). But there are two timezones that I have a really hard time to test, since I can not set my system to observe these timezones. The timezones I am talking about are UTC+1245 (Chatham Islands, NZ) and UTC+0845 (Australia/Eucla). As far as I can tell in OSX (Snow Leopard) and in Windows 7 these timezones do not exist as a setting. Granted, very few people live in these areas, and it might just not be worth it. Does anyone know of a way to set these timezones on a system level? In any operating system? If it is not possible in a trivial way, what do people who live in these areas do to get their systems working as they would like?

    Read the article

  • Optimizing python code performance when importing zipped csv to a mongo collection

    - by mark
    I need to import a zipped csv into a mongo collection, but there is a catch - every record contains a timestamp in Pacific Time, which must be converted to the local time corresponding to the (longitude,latitude) pair found in the same record. The code looks like so: def read_csv_zip(path, timezones): with ZipFile(path) as z, z.open(z.namelist()[0]) as input: csv_rows = csv.reader(input) header = csv_rows.next() check,converters = get_aux_stuff(header) for csv_row in csv_rows: if check(csv_row): row = { converter[0]:converter[1](value) for converter, value in zip(converters, csv_row) if allow_field(converter) } ts = row['ts'] lng, lat = row['loc'] found_tz_entry = timezones.find_one(SON({'loc': {'$within': {'$box': [[lng-tz_lookup_radius, lat-tz_lookup_radius],[lng+tz_lookup_radius, lat+tz_lookup_radius]]}}})) if found_tz_entry: tz_name = found_tz_entry['tz'] local_ts = ts.astimezone(timezone(tz_name)).replace(tzinfo=None) row['tz'] = tz_name else: local_ts = (ts.astimezone(utc) + timedelta(hours = int(lng/15))).replace(tzinfo = None) row['local_ts'] = local_ts yield row def insert_documents(collection, source, batch_size): while True: items = list(itertools.islice(source, batch_size)) if len(items) == 0: break; try: collection.insert(items) except: for item in items: try: collection.insert(item) except Exception as exc: print("Failed to insert record {0} - {1}".format(item['_id'], exc)) def main(zip_path): with Connection() as connection: data = connection.mydb.data timezones = connection.timezones.data insert_documents(data, read_csv_zip(zip_path, timezones), 1000) The code proceeds as follows: Every record read from the csv is checked and converted to a dictionary, where some fields may be skipped, some titles be renamed (from those appearing in the csv header), some values may be converted (to datetime, to integers, to floats. etc ...) For each record read from the csv, a lookup is made into the timezones collection to map the record location to the respective time zone. If the mapping is successful - that timezone is used to convert the record timestamp (pacific time) to the respective local timestamp. If no mapping is found - a rough approximation is calculated. The timezones collection is appropriately indexed, of course - calling explain() confirms it. The process is slow. Naturally, having to query the timezones collection for every record kills the performance. I am looking for advises on how to improve it. Thanks. EDIT The timezones collection contains 8176040 records, each containing four values: > db.data.findOne() { "_id" : 3038814, "loc" : [ 1.48333, 42.5 ], "tz" : "Europe/Andorra" } EDIT2 OK, I have compiled a release build of http://toblerity.github.com/rtree/ and configured the rtree package. Then I have created an rtree dat/idx pair of files corresponding to my timezones collection. So, instead of calling collection.find_one I call index.intersection. Surprisingly, not only there is no improvement, but it works even more slowly now! May be rtree could be fine tuned to load the entire dat/idx pair into RAM (704M), but I do not know how to do it. Until then, it is not an alternative. In general, I think the solution should involve parallelization of the task. EDIT3 Profile output when using collection.find_one: >>> p.sort_stats('cumulative').print_stats(10) Tue Apr 10 14:28:39 2012 ImportDataIntoMongo.profile 64549590 function calls (64549180 primitive calls) in 1231.257 seconds Ordered by: cumulative time List reduced from 730 to 10 due to restriction <10> ncalls tottime percall cumtime percall filename:lineno(function) 1 0.012 0.012 1231.257 1231.257 ImportDataIntoMongo.py:1(<module>) 1 0.001 0.001 1230.959 1230.959 ImportDataIntoMongo.py:187(main) 1 853.558 853.558 853.558 853.558 {raw_input} 1 0.598 0.598 370.510 370.510 ImportDataIntoMongo.py:165(insert_documents) 343407 9.965 0.000 359.034 0.001 ImportDataIntoMongo.py:137(read_csv_zip) 343408 2.927 0.000 287.035 0.001 c:\python27\lib\site-packages\pymongo\collection.py:489(find_one) 343408 1.842 0.000 274.803 0.001 c:\python27\lib\site-packages\pymongo\cursor.py:699(next) 343408 2.542 0.000 271.212 0.001 c:\python27\lib\site-packages\pymongo\cursor.py:644(_refresh) 343408 4.512 0.000 253.673 0.001 c:\python27\lib\site-packages\pymongo\cursor.py:605(__send_message) 343408 0.971 0.000 242.078 0.001 c:\python27\lib\site-packages\pymongo\connection.py:871(_send_message_with_response) Profile output when using index.intersection: >>> p.sort_stats('cumulative').print_stats(10) Wed Apr 11 16:21:31 2012 ImportDataIntoMongo.profile 41542960 function calls (41542536 primitive calls) in 2889.164 seconds Ordered by: cumulative time List reduced from 778 to 10 due to restriction <10> ncalls tottime percall cumtime percall filename:lineno(function) 1 0.028 0.028 2889.164 2889.164 ImportDataIntoMongo.py:1(<module>) 1 0.017 0.017 2888.679 2888.679 ImportDataIntoMongo.py:202(main) 1 2365.526 2365.526 2365.526 2365.526 {raw_input} 1 0.766 0.766 502.817 502.817 ImportDataIntoMongo.py:180(insert_documents) 343407 9.147 0.000 491.433 0.001 ImportDataIntoMongo.py:152(read_csv_zip) 343406 0.571 0.000 391.394 0.001 c:\python27\lib\site-packages\rtree-0.7.0-py2.7.egg\rtree\index.py:384(intersection) 343406 379.957 0.001 390.824 0.001 c:\python27\lib\site-packages\rtree-0.7.0-py2.7.egg\rtree\index.py:435(_intersection_obj) 686513 22.616 0.000 38.705 0.000 c:\python27\lib\site-packages\rtree-0.7.0-py2.7.egg\rtree\index.py:451(_get_objects) 343406 6.134 0.000 33.326 0.000 ImportDataIntoMongo.py:162(<dictcomp>) 346 0.396 0.001 30.665 0.089 c:\python27\lib\site-packages\pymongo\collection.py:240(insert) EDIT4 I have parallelized the code, but the results are still not very encouraging. I am convinced it could be done better. See my own answer to this question for details.

    Read the article

  • Why is this giving me 2 different sets of timezones?

    - by chobo2
    Hi I have this line to get all the timezones Dictionary<string, TimeZoneInfo> storeZoneName = TimeZoneInfo.GetSystemTimeZones().ToDictionary(z => z.DisplayName); Now when I upload I try it on my local machine I get this (UTC-12:00) International Date Line West (UTC-11:00) Coordinated Universal Time-11 (UTC-11:00) Samoa (UTC-10:00) Hawaii (UTC-09:00) Alaska (UTC-08:00) Baja California (UTC-08:00) Pacific Time (US & Canada) (UTC-07:00) Arizona (UTC-07:00) Chihuahua, La Paz, Mazatlan (UTC-07:00) Mountain Time (US & Canada) (UTC-06:00) Central America (UTC-06:00) Central Time (US & Canada) (UTC-06:00) Guadalajara, Mexico City, Monterrey (UTC-06:00) Saskatchewan (UTC-05:00) Bogota, Lima, Quito (UTC-05:00) Eastern Time (US & Canada) (UTC-05:00) Indiana (East) (UTC-04:30) Caracas (UTC-04:00) Asuncion (UTC-04:00) Atlantic Time (Canada) (UTC-04:00) Cuiaba (UTC-04:00) Georgetown, La Paz, Manaus, San Juan (UTC-04:00) Santiago (UTC-03:30) Newfoundland (UTC-03:00) Brasilia (UTC-03:00) Buenos Aires (UTC-03:00) Cayenne, Fortaleza (UTC-03:00) Greenland (UTC-03:00) Montevideo (UTC-02:00) Coordinated Universal Time-02 (UTC-02:00) Mid-Atlantic (UTC-01:00) Azores (UTC-01:00) Cape Verde Is. (UTC) Casablanca (UTC) Coordinated Universal Time (UTC) Dublin, Edinburgh, Lisbon, London (UTC) Monrovia, Reykjavik (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna (UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague (UTC+01:00) Brussels, Copenhagen, Madrid, Paris (UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb (UTC+01:00) West Central Africa (UTC+02:00) Amman (UTC+02:00) Athens, Bucharest, Istanbul (UTC+02:00) Beirut (UTC+02:00) Cairo (UTC+02:00) Harare, Pretoria (UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius (UTC+02:00) Jerusalem (UTC+02:00) Minsk (UTC+02:00) Windhoek (UTC+03:00) Baghdad (UTC+03:00) Kuwait, Riyadh (UTC+03:00) Moscow, St. Petersburg, Volgograd (UTC+03:00) Nairobi (UTC+03:30) Tehran (UTC+04:00) Abu Dhabi, Muscat (UTC+04:00) Baku (UTC+04:00) Port Louis (UTC+04:00) Tbilisi (UTC+04:00) Yerevan (UTC+04:30) Kabul (UTC+05:00) Ekaterinburg (UTC+05:00) Islamabad, Karachi (UTC+05:00) Tashkent (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi (UTC+05:30) Sri Jayawardenepura (UTC+05:45) Kathmandu (UTC+06:00) Astana (UTC+06:00) Dhaka (UTC+06:00) Novosibirsk (UTC+06:30) Yangon (Rangoon) (UTC+07:00) Bangkok, Hanoi, Jakarta (UTC+07:00) Krasnoyarsk (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi (UTC+08:00) Irkutsk (UTC+08:00) Kuala Lumpur, Singapore (UTC+08:00) Perth (UTC+08:00) Taipei (UTC+08:00) Ulaanbaatar (UTC+09:00) Osaka, Sapporo, Tokyo (UTC+09:00) Seoul (UTC+09:00) Yakutsk (UTC+09:30) Adelaide (UTC+09:30) Darwin (UTC+10:00) Brisbane (UTC+10:00) Canberra, Melbourne, Sydney (UTC+10:00) Guam, Port Moresby (UTC+10:00) Hobart (UTC+10:00) Vladivostok (UTC+11:00) Magadan, Solomon Is., New Caledonia (UTC+12:00) Auckland, Wellington (UTC+12:00) Coordinated Universal Time+12 (UTC+12:00) Fiji (UTC+12:00) Petropavlovsk-Kamchatsky (UTC+13:00) Nuku'alofa When I run it on a different local machine or my server I have this. <option value="(GMT) Casablanca">(GMT) Casablanca</option> <option value="(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London">(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London</option> <option value="(GMT) Monrovia, Reykjavik">(GMT) Monrovia, Reykjavik</option> <option value="(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna">(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</option> <option value="(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague">(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option> <option value="(GMT+01:00) Brussels, Copenhagen, Madrid, Paris">(GMT+01:00) Brussels, Copenhagen, Madrid, Paris</option> <option value="(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb">(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb</option> <option value="(GMT+01:00) West Central Africa">(GMT+01:00) West Central Africa</option> <option value="(GMT+02:00) Amman">(GMT+02:00) Amman</option> <option value="(GMT+02:00) Athens, Bucharest, Istanbul">(GMT+02:00) Athens, Bucharest, Istanbul</option> <option value="(GMT+02:00) Beirut">(GMT+02:00) Beirut</option> <option value="(GMT+02:00) Cairo">(GMT+02:00) Cairo</option> <option value="(GMT+02:00) Harare, Pretoria">(GMT+02:00) Harare, Pretoria</option> <option value="(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius">(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius</option> <option value="(GMT+02:00) Jerusalem">(GMT+02:00) Jerusalem</option> <option value="(GMT+02:00) Minsk">(GMT+02:00) Minsk</option> <option value="(GMT+02:00) Windhoek">(GMT+02:00) Windhoek</option> <option value="(GMT+03:00) Baghdad">(GMT+03:00) Baghdad</option> <option value="(GMT+03:00) Kuwait, Riyadh">(GMT+03:00) Kuwait, Riyadh</option> <option value="(GMT+03:00) Moscow, St. Petersburg, Volgograd">(GMT+03:00) Moscow, St. Petersburg, Volgograd</option> <option value="(GMT+03:00) Nairobi">(GMT+03:00) Nairobi</option> <option value="(GMT+03:00) Tbilisi">(GMT+03:00) Tbilisi</option> <option value="(GMT+03:30) Tehran">(GMT+03:30) Tehran</option> <option value="(GMT+04:00) Abu Dhabi, Muscat">(GMT+04:00) Abu Dhabi, Muscat</option> <option value="(GMT+04:00) Baku">(GMT+04:00) Baku</option> <option value="(GMT+04:00) Port Louis">(GMT+04:00) Port Louis</option> <option value="(GMT+04:00) Yerevan">(GMT+04:00) Yerevan</option> <option value="(GMT+04:30) Kabul">(GMT+04:30) Kabul</option> <option value="(GMT+05:00) Ekaterinburg">(GMT+05:00) Ekaterinburg</option> <option value="(GMT+05:00) Islamabad, Karachi">(GMT+05:00) Islamabad, Karachi</option> <option value="(GMT+05:00) Tashkent">(GMT+05:00) Tashkent</option> <option value="(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi">(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi</option> <option value="(GMT+05:30) Sri Jayawardenepura">(GMT+05:30) Sri Jayawardenepura</option> <option value="(GMT+05:45) Kathmandu">(GMT+05:45) Kathmandu</option> <option value="(GMT+06:00) Almaty, Novosibirsk">(GMT+06:00) Almaty, Novosibirsk</option> <option value="(GMT+06:00) Astana, Dhaka">(GMT+06:00) Astana, Dhaka</option> <option value="(GMT+06:30) Yangon (Rangoon)">(GMT+06:30) Yangon (Rangoon)</option> <option value="(GMT+07:00) Bangkok, Hanoi, Jakarta">(GMT+07:00) Bangkok, Hanoi, Jakarta</option> <option value="(GMT+07:00) Krasnoyarsk">(GMT+07:00) Krasnoyarsk</option> <option value="(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi">(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi</option> <option value="(GMT+08:00) Irkutsk, Ulaan Bataar">(GMT+08:00) Irkutsk, Ulaan Bataar</option> <option value="(GMT+08:00) Kuala Lumpur, Singapore">(GMT+08:00) Kuala Lumpur, Singapore</option> <option value="(GMT+08:00) Perth">(GMT+08:00) Perth</option> <option value="(GMT+08:00) Taipei">(GMT+08:00) Taipei</option> <option value="(GMT+09:00) Osaka, Sapporo, Tokyo">(GMT+09:00) Osaka, Sapporo, Tokyo</option> <option value="(GMT+09:00) Seoul">(GMT+09:00) Seoul</option> <option value="(GMT+09:00) Yakutsk">(GMT+09:00) Yakutsk</option> <option value="(GMT+09:30) Adelaide">(GMT+09:30) Adelaide</option> <option value="(GMT+09:30) Darwin">(GMT+09:30) Darwin</option> <option value="(GMT+10:00) Brisbane">(GMT+10:00) Brisbane</option> <option value="(GMT+10:00) Canberra, Melbourne, Sydney">(GMT+10:00) Canberra, Melbourne, Sydney</option> <option value="(GMT+10:00) Guam, Port Moresby">(GMT+10:00) Guam, Port Moresby</option> <option value="(GMT+10:00) Hobart">(GMT+10:00) Hobart</option> <option value="(GMT+10:00) Vladivostok">(GMT+10:00) Vladivostok</option> <option value="(GMT+11:00) Magadan, Solomon Is., New Caledonia">(GMT+11:00) Magadan, Solomon Is., New Caledonia</option> <option value="(GMT+12:00) Auckland, Wellington">(GMT+12:00) Auckland, Wellington</option> <option value="(GMT+12:00) Fiji, Kamchatka, Marshall Is.">(GMT+12:00) Fiji, Kamchatka, Marshall Is.</option> <option value="(GMT+13:00) Nuku'alofa">(GMT+13:00) Nuku'alofa</option> <option value="(GMT-01:00) Azores">(GMT-01:00) Azores</option> <option value="(GMT-01:00) Cape Verde Is.">(GMT-01:00) Cape Verde Is.</option> <option value="(GMT-02:00) Mid-Atlantic">(GMT-02:00) Mid-Atlantic</option> <option value="(GMT-03:00) Brasilia">(GMT-03:00) Brasilia</option> <option value="(GMT-03:00) Buenos Aires">(GMT-03:00) Buenos Aires</option> <option value="(GMT-03:00) Georgetown">(GMT-03:00) Georgetown</option> <option value="(GMT-03:00) Greenland">(GMT-03:00) Greenland</option> <option value="(GMT-03:00) Montevideo">(GMT-03:00) Montevideo</option> <option value="(GMT-03:30) Newfoundland">(GMT-03:30) Newfoundland</option> <option value="(GMT-04:00) Atlantic Time (Canada)">(GMT-04:00) Atlantic Time (Canada)</option> <option value="(GMT-04:00) La Paz">(GMT-04:00) La Paz</option> <option value="(GMT-04:00) Manaus">(GMT-04:00) Manaus</option> <option value="(GMT-04:00) Santiago">(GMT-04:00) Santiago</option> <option value="(GMT-04:30) Caracas">(GMT-04:30) Caracas</option> <option value="(GMT-05:00) Bogota, Lima, Quito, Rio Branco">(GMT-05:00) Bogota, Lima, Quito, Rio Branco</option> <option value="(GMT-05:00) Eastern Time (US &amp; Canada)">(GMT-05:00) Eastern Time (US &amp; Canada)</option> <option value="(GMT-05:00) Indiana (East)">(GMT-05:00) Indiana (East)</option> <option value="(GMT-06:00) Central America">(GMT-06:00) Central America</option> <option value="(GMT-06:00) Central Time (US &amp; Canada)">(GMT-06:00) Central Time (US &amp; Canada)</option> <option value="(GMT-06:00) Guadalajara, Mexico City, Monterrey">(GMT-06:00) Guadalajara, Mexico City, Monterrey</option> <option value="(GMT-06:00) Saskatchewan">(GMT-06:00) Saskatchewan</option> <option value="(GMT-07:00) Arizona">(GMT-07:00) Arizona</option> <option value="(GMT-07:00) Chihuahua, La Paz, Mazatlan">(GMT-07:00) Chihuahua, La Paz, Mazatlan</option> <option value="(GMT-07:00) Mountain Time (US &amp; Canada)">(GMT-07:00) Mountain Time (US &amp; Canada)</option> <option value="(GMT-08:00) Pacific Time (US &amp; Canada)">(GMT-08:00) Pacific Time (US &amp; Canada)</option> <option value="(GMT-08:00) Tijuana, Baja California">(GMT-08:00) Tijuana, Baja California</option> <option value="(GMT-09:00) Alaska">(GMT-09:00) Alaska</option> <option value="(GMT-10:00) Hawaii">(GMT-10:00) Hawaii</option> <option value="(GMT-11:00) Midway Island, Samoa">(GMT-11:00) Midway Island, Samoa</option> <option value="(GMT-12:00) International Date Line West">(GMT-12:00) International Date Line West</option> They are different. Same line of code but one is GMT and one is UTC. How can I force it to be always the same? Also I want to have a default choice of "UTC" but I am not sure what the diff is between this (UTC-11:00) Coordinated Universal Time-11 and this (UTC-02:00) Coordinated Universal Time-02

    Read the article

  • How can I switch timezones in Perl's Template::Plugin::Date?

    - by aidan
    I have a calendar on my website, generated in Perl using Template::Toolkit and Template::Plugin::Date. It highlights the current day. I achieve this by iterating through all the dates (as I print the calendar) and comparing against the current date. Something like this: [% IF cur_date == date.format(format = '%Y-%m-%d') %] ... [% END %] It all works well until someone in Australia looks at it. (They are in a different timezone to me and my server in the UK). What's the best way to get Template::Plugin::Date to use a different time zone? It accepts a 'locale' parameter, but AFAIK this is only used for formatting.

    Read the article

  • How do I use timezones with a datetime object in python?

    - by jidar
    How do I properly represent a different timezone in my timezone? The below example only works because I know that EDT is one hour ahead of me, so I can uncomment the subtraction of myTimeZone() import datetime, re from datetime import tzinfo class myTimeZone(tzinfo): """docstring for myTimeZone""" def utfoffset(self, dt): return timedelta(hours=1) def myDateHandler(aDateString): """u'Sat, 6 Sep 2008 21:16:33 EDT'""" _my_date_pattern = re.compile(r'\w+\,\s+(\d+)\s+(\w+)\s+(\d+)\s+(\d+)\:(\d+)\:(\d+)') day, month, year, hour, minute, second = _my_date_pattern.search(aDateString).groups() month = [ 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC' ].index(month.upper()) + 1 dt = datetime.datetime( int(year), int(month), int(day), int(hour), int(minute), int(second) ) # dt = dt - datetime.timedelta(hours=1) # dt = dt - dt.tzinfo.utfoffset(myTimeZone()) return (dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, 0, 0, 0) def main(): print myDateHandler("Sat, 6 Sep 2008 21:16:33 EDT") if __name__ == '__main__': main()

    Read the article

  • Why does Rails screw up timezones when I am editing a resource?

    - by DJTripleThreat
    Steps to produce this: prompt>rails test_app prompt>cd test_app prompt>script/generate scaffold date_test my_date:datetime prompt>rake db:migrate now edit your app/views/date_tests/edit.html.erb: <h1>Editing date_test</h1> <% form_for(@date_test) do |f| %> <%= f.error_messages %> <p> RIGHT!<br/> <%= text_field_tag @date_test, f.object.my_date %> </p> <p> WRONG!<br /> <%= f.text_field :my_date %> </p> <p> <%= f.submit 'Update' %> </p> <% end %> <%= link_to 'Show', @date_test %> | <%= link_to 'Back', date_tests_path %> now edit your config/environment.rb: #add this config.time_zone = 'Central Time (US & Canada)' This recreates the problem I am having in my actual app. The problem with my app is that I'm storing a date in a hidden field and rendering a "user friendly" version. Creating a resource works fine but as soon as I try to edit it the time changes (it adds the difference between my current time zone configuration and UTC). go to http://localhost:3000/date_tests/new and save the time then go to reedit it and you will have two different representations of the date/time one which will save incorrectly and the other that will.

    Read the article

  • send email to list of users with different timezones?

    - by ylazez
    i use the following method to send email to list of users i want the (To) in each email to be for just the user only not all users i.e appears to the users that the email is sent to only him my guess is to loop on: message.addRecipients(Message.RecipientType.TO, address); then send the message right? , but this is a heavy process sending an email many times any ideas ? suppose that i have the timezone for each user and i want to send each user the message in his timzone, the same issue i guess setting sent date for each user in his timezone then sending the message, right ? the method is: try { Properties props = System.getProperties(); props.put("mail.smtp.host", "localhost"); // Get a mail session Session session = Session.getDefaultInstance(props, null); // Define a new mail message Message message = new MimeMessage(session); InternetAddress ia = new InternetAddress(); ia.setPersonal("MySite"); ia.setAddress(from); message.setFrom(ia); Address[] address = new Address[recievers.size()]; for (int i = 0; i < recievers.size(); i++) { address[i] = new InternetAddress(recievers.get(i)); } message.addRecipients(Message.RecipientType.TO, address); message.setSubject(subject); // Create a message part to represent the body text BodyPart messageBodyPart = new MimeBodyPart(); messageBodyPart.setContent(body, "text/html"); // use a MimeMultipart as we need to handle the file attachments Multipart multipart = new MimeMultipart(); // add the message body to the mime message multipart.addBodyPart(messageBodyPart); // Put all message parts in the message message.setContent(multipart); message.setSentDate(getCurrentDate()); // Send the message Transport.send(message); } catch (Exception ex) {}

    Read the article

  • How do I find difference between times in different timezones in Python?

    - by JasonA
    Hi All, I am trying to calculate difference(in seconds) between two date/times formatted as following: 2010-05-11 17:07:33 UTC 2010-05-11 17:07:33 EDT time1 = '2010-05-11 17:07:33 UTC' time2 = '2010-05-11 17:07:33 EDT' delta = time.mktime(time.strptime(time1,"%Y-%m-%d %H:%M:%S %Z"))-\ time.mktime(time.strptime(time2, "%Y-%m-%d %H:%M:%S %Z")) The problem I got is EDT is not recognized, the specific error is "ValueError: time data '2010-05-11 17:07:33 EDT' does not match format '%Y-%m-%d %H:%M:%S %Z'" Thanks,

    Read the article

  • Is it possible to create a timer in jscript that you can manually change without it being affected by timezones?

    - by Lixorp
    is it possible to create a timer where I can manually set the hours each day to a set number of hours but still remains accurate? For example; if I set the countdown for 5 hours at 2pm I want the timer to stop as soon as it hits 7pm. Also, when I set the timer for 5 hours I would like everyone in the world to see it countdown from 5 hours, no matter what the time is in their country. In the format: days hours minutes seconds. The reason I want to do this is for a streamer's website. He needs a flexible timer which can be manually changed and is the same worldwide for his viewers to know when he starts streaming. The current timer we're using at the moment; setInterval(function(){ var currentTime = new Date(); if(currentTime.getHours() > 19){ var countdownHours = (24 - currentTime.getHours()) + 19; }else if(currentTime.getHours() < 19){ var countdownHours = 19 - currentTime.getHours(); }else{ var countdownHours = 0; } var countdownMins = 59 - currentTime.getMinutes(); var countdownSecs = 60 - currentTime.getSeconds(); $('#countdown-days h1').text('0'); $('#countdown-hours h1').text(countdownHours); $('#countdown-minutes h1').text(countdownMins); $('#countdown-seconds h1').text(countdownSecs); }, 1000); As you can tell it isn't ideal for what we need it for since it counts down to 7pm in the timezone you're in. Any help/examples would be greatly appreciated, Thank you in advance, Lixorp.

    Read the article

  • Cannot run logwatch due to Date::Manip issue

    - by Quintin Par
    I tried to run logwatch at follows [root@machine cron.daily]# ./0logwatch ERROR: Date::Manip unable to determine TimeZone. Execute the following command in a shell prompt: perldoc Date::Manip The section titled TIMEZONES describes valid TimeZones and where they can be defined. My date is as follows root@machine cron.daily]# date Thu Aug 23 06:25:21 GMT 2012 Now based on details in various forums I tried to fix this by setting /etc/timezone to “+0800” but it didn’t work My /etc/localtime points to /usr/share/zoneinfo/GMT and is managed by puppet How do I go about fixing this? I still want all my machines to be in GMT timezone. EDIT: Sadly, Both the changes are not working: [root@machine cron.daily]# cat /etc/TIMEZONE UTC Quanta’s [root@machine cron.daily]# cat ~/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export TZ=GMT export PATH [root@machine cron.daily]# source ~/.bash_profile [root@machine cron.daily]# ./0logwatch ERROR: Date::Manip unable to determine TimeZone. Execute the following command in a shell prompt: perldoc Date::Manip The section titled TIMEZONES describes valid TimeZones and where they can be defined.

    Read the article

  • Globalization for GetSystemTimeZones()

    - by user300992
    I want to get a list of timezones, so that i can populate the dropdown list. In .NET 3.5, we have TimeZoneInfo namespace, here is the code: ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones(); foreach (TimeZoneInfo timeZone in timeZones) string name = timeZone.DisplayName However, "DisplayName" is in English. How can I pass the cultureInfo so that it can return other languages? I tried setting the Thread.CurrentCulture and CurrentUICulture, it didn't work. Am I missing something?

    Read the article

  • Is it safe to run upgrade with Pinned Applications in Synaptic

    - by BlueXrider
    I have firefox, thunderbird, thunderbird-locale-en, thunderbird-locale-en-us, xul-ext-calendar-timezones, xul-ext-gdata-provider and xul-ext-lightning pinned in Synaptic. When I run apt-get upgrade. I get the following The following packages will be upgraded: boot-repair boot-sav darktable firefox libvlc5 libvlccore5 thunderbird thunderbird-locale-en thunderbird-locale-en-us vlc vlc-data vlc-nox vlc-plugin-notify vlc-plugin-pulse xul-ext-calendar-timezones xul-ext-gdata-provider xul-ext-lightning 17 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 53.0 MB of archives. After this operation, 606 kB of additional disk space will be used. Do you want to continue [Y/n]? Are these packages really going to be upgraded?

    Read the article

  • Rails time zones

    - by Bob
    I'm calling an external web service API that returns a timezone as listed in the Olson timezones database (e.g. "America/New_York"). However some of the values the API returned are "US/Pacific", "US/Eastern" and apparently don't match any of the Olson timezones in Rails 2.3.2. Can anyone shed some light on this? Thanks in advance for your help.

    Read the article

  • python : in which timezone is it a specific time right now?

    - by kevin
    i have users from all timezones, and i want to send out alerts at around 8AM in each users respective timezone. i need a python script that runs every hour [in a cron job] and i need to find out at which timezone it is 8AM right now, and i can use that info to select the users that have to receive the alerts. how do i go about doing this? there seems to be gmt+14 to gmt-12 that is 27 timezones, and there are only 24 hours in a day!

    Read the article

  • Autodetect timezone in Rails given UTC offset and DST

    - by Jose
    I basically want to autodetect a user's timezone using Rails. I can use this JS code at the user's browser (http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/) to send a form with the UTC offset and the fact that the time zone observes DST during summer or not, in the user's time zone. Once I have that info in the server, I want to select the matching time zone. In Rails, I can get a list of time zones with ActiveSupport::TimeZone.all. Also, I can filter zones by utf offset thanks to the utc_offset method. However, I don't know how to filter the timezones that do/don't observe DST. E.g. suppose a user lives in Amsterdam. Filtering by UTC offset will return Berlin, Belgrado, Madrid, etc timezones, as well as West Central Africa. All of them, but West Central Africa, would be appropriate timezones for a user in Amsterdam (as they provide the same time/date), but I need to filter West Central Africa, which does not perform DST in summer. How can I do this in Rails? Also, are any of my assumptions wrong?

    Read the article

  • How-to create a select one choice listing common time zones

    - by frank.nimphius
    Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} ADF Faces provides an option to query a list of common timezones for display in a Select One Choice component. The EL expression for this is #{af:getCommonTimeZoneSelectItems()}. To use this expression in a Single Select One Choice component, drag and drop the component from the Oracle JDeveloper Component Palette into a JSF page.  In the opened dialog, copy the expression into the Value property below the Bind to list (select items) header. <af:selectOneChoice label="TimeZones" id="soc1">  <f:selectItems value="#{af:getCommonTimeZoneSelectItems()}"                          id="si1"/></af:selectOneChoice>

    Read the article

  • Joda-Time: DateTime, DateMidnight and LocalDate usage

    - by fraido
    Joda-Time library includes different datetime classes DateTime - Immutable replacement for JDK Calendar DateMidnight - Immutable class representing a date where the time is forced to midnight LocalDateTime - Immutable class representing a local date and time (no time zone) I'm wondering how are you using these classes in your Layered Applications. I see advantages in having almost all the Interfaces using LocalDateTime (at the Service Layer at least) so that my Application doesn't have to manage Timezones and can safely assume Times always in UTC. My app could then use DateTime to manage Timezones at the very beginning of the Execution's Flow. I'm also wondering in which scenario can DateMidnight be useful.

    Read the article

  • I18n translation problem

    - by kshchepelin
    I'm about to translate all time zones to Russian and I've done such things: model: # lib/i18n_time_zone.rb class I18nTimeZone < ActiveSupport::TimeZone def self.all super.map { |z| create(z.name, z.utc_offset) } end def to_s translated_name = I18n.t(name, :scope => :timezones, :default => name) "(GMT#{formatted_offset}) #{translated_name}" end end view: <%= time_zone_select :user, :time_zone, nil, :model => I18nTimeZone %> locale file (/config/locales/ru.yml): ru: timezones: "Midway Island": "??????" "Samoa": "?????" .... But there are cases when original string includes some dots (".") Like "St. Petersburg" And I18n.t() tells me that translation is missing. How can I avoid it?

    Read the article

  • Ubuntu worldtime desktop clock widget?

    - by ubuntico
    I am aware that in Unity we can add world time by clicking on time bar. However, it's still a list of locations and sometimes it may be hard to quickly find the timezone of interest. Is there any tool which can put a multiple clock instances on the desktop representing each timezone of interest? Similar to the clock in Windows 7. To be more clear, I am not looking for a weather widget, but a simple clock widget so that I can track time in different timezones.

    Read the article

  • Exchange 2010 update timezone of all calendar items

    - by Andrew
    We are currently operating Exchange 2010 server with Outlook 2010 clients on a ship. We have just changed timezones for the first time in quite a while today. Is there any way to rebase all the calendars and/or update all the calendar items to the new timezone at the same time? I have looked at the following tools already. Microsoft Exchange Calendar Update Configuration Tool - http://www.microsoft.com/en-us/download/details.aspx?id=6266 (Doesn't support exchange 2010) Time Zone Data Update Tool for Microsoft Office Outlook - http://www.microsoft.com/en-us/download/details.aspx?id=17291 The Time Zone Data Update Tool for Microsoft Office Outlook does work for individual users, but has some serious downsides. Including each user needs to run it (approx 400 users), and also it only seems to work on the default account in Outlook 2010, a lot of our users have role accounts as well that we would need to run the tool on. The only way I can find to get this tool to run on the role accounts is to make the role account the default account in outlook, and that in itself is quiet an involved process especially if you have 2 or 3 role accounts. So is there a way to just change all calendar items on our Exchange server to a different timezone in one go? We are a little unique in terms of the whole organisation can change timezones over night, meeting rooms and all, but surely a product as advanced as Exchange 2010 allows us to do what we need.

    Read the article

  • Windows Backup (2008 R2) recovery and timezone

    - by GrZeCh
    Hello, does difference between timezones on Windows Server 2008 where backup was made and reovery console makes difference? Recovery console (wbadmin from command line too) is not finding any backup on local hard drive connected to server. Thanks EDIT: I'm working on Windows Server 2008 R2 EDIT2: This is not related to timezone. When I connected backup hard drive from Windows 2008 R2 Release Candidate recovery console runned from RTM system version DVD found stored backups from it without problems.

    Read the article

  • DBaaS Online Forum - Now available on-demand

    - by Javier Puerta
    The Database-as-a-Service Online Forum  was originally broadcasted on Monday, October 21, 2013, at a US-timezones time. All the content of the forum is now available on-demand for customers and partners to watch and listen to. The content is available on demand here. Watch the on-demand forum to hear from analysts and experts on how companies are beginning to transform with Database as a Service, and learn the prescriptive steps your organization can take to design, deploy, and deliver Database as a Service today   Agenda  Keynote Carl Olofson, Research VP, IDC Juan Loaiza, Senior Vice President, Oracle Systems Technology Todd Kimbriel, Director, State of Texas, eGovernment Division Eric Zonneveld, Oracle Architect, KPN James Anthony, Technology Director, e-DBA Breakout 1: Design DBaaS Alan Levine, Senior Director, Oracle Enterprise Architects Breakout 2: Deploy DBaaS Michael Timpanaro-Perrotta, Director of Product Management, Oracle Breakout 3: Deliver DBaaS  Sudip Datta, Vice President of Product Management, Oracle Closing Session Michelle Malcher, IOUG President Juan Loaiza, Senior Vice President, Oracle Systems Technology

    Read the article

  • DBaaS Online Forum - Now available on-demand

    - by Javier Puerta
    The Database-as-a-Service Online Forum  was originally broadcasted on Monday, October 21, 2013, at a US-timezones time. All the content of the forum is now available on-demand for customers and partners to watch and listen to. The content is available on demand here. Watch the on-demand forum to hear from analysts and experts on how companies are beginning to transform with Database as a Service, and learn the prescriptive steps your organization can take to design, deploy, and deliver Database as a Service today   Agenda  Keynote Carl Olofson, Research VP, IDC Juan Loaiza, Senior Vice President, Oracle Systems Technology Todd Kimbriel, Director, State of Texas, eGovernment Division Eric Zonneveld, Oracle Architect, KPN James Anthony, Technology Director, e-DBA   Breakout 1: Design DBaaS Alan Levine, Senior Director, Oracle Enterprise Architects   Breakout 2: Deploy DBaaS Michael Timpanaro-Perrotta, Director of Product Management, Oracle   Breakout 3: Deliver DBaaS  Sudip Datta, Vice President of Product Management, Oracle   Closing Session Michelle Malcher, IOUG President Juan Loaiza, Senior Vice President, Oracle Systems Technology

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >