Search Results

Search found 835 results on 34 pages for 'utc'.

Page 3/34 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • PHP Default Timezone issue on Fedora + Zend Server CE

    - by Dave Morris
    I have ZendServer CE (PHP 5.2) installed on a Fedora VM, and I have the system timezone set to 'America/Chicago'. I have date.timezone = 'UTC' in my php.ini file, and when I call date_default_timezone_get(), or display date('T') on a web page, it says 'CDT'. The documentation on php.net for date_default_timezone_get() says it follows this order when choosing a default timezone: - Reading the timezone set using the date_default_timezone_set() function (if any) - Reading the TZ environment variable (if non empty) - Reading the value of the date.timezone ini option (if set) - Querying the host operating system (if supported and allowed by the OS) If I change the system timezone through the 'setup' GUI, and reboot the server, date('T') returns whatever I changed the system timezone to, regardless of what php.ini says. I also don't have a TZ environment variable, and I am not currently using date_default_timezone_set() anywhere in my code. Any idea what might be going on? I realize I can always override the system timezone by calling date_default_timezone_set('UTC'), but I'd rather rely on the php.ini file if possible. Thanks for the help, Dave

    Read the article

  • Haskell Convert Byte String To UTC Time

    - by Steve
    I have been trying to make a function in Haskell to take a ByteString which is a datetime and convert it to UTC time taking into account the time zone from the original encoding. I am very new to Haskell so I may be making a really basic mistake. convertStringToUtc s = do estTimeZone <- hoursToTimeZone -5 time <- read $ B.unpack(s) localTimeToUTC estTimeZone time The error I get is: Couldn't match expected type `Int -> b' against inferred type `UTCTime' In the expression: localTimeToUTC estTimeZone time In the expression: do { estTimeZone <- hoursToTimeZone - 5; time <- read $ B.unpack (s); localTimeToUTC estTimeZone time }

    Read the article

  • Wunderground and UTC Offset

    - by Brandon
    I am consuming the international weather forecasts via Wunderground's XML API: http://wiki.wunderground.com/index.php/API_-_XML Looking at an output for Kabul, Afghanistan for instance: http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=OAKB I notice that there is no UTC offset. The closest that I can see is this: <tz_short>AFT</tz_short> Which identifies the current TimeZone is AFT. The problem I see is that there is no universally accepted time zone abbreviations, so I cannot take these abbreviations and look up and offset from C#'s TimeZoneInfo objects. Is there a listing of Wunderground's Time Zones abbreviations/names/offsets so I can map their Time Zones to the TimeZoneInfo objects, or is there a better way to get this information? I will need to use the TimeZoneInfo so I can calculate daylight savings time for different locations internationally.

    Read the article

  • How reliable is DateTime.UtcNow in Silverlight applications?

    - by Edward Tanguay
    I have a silverlight application which users will be running in various time zones. These applications load their data from the server upon start up, then cache it in IsolatedStorage. When I make changes to the data on the server, I want to be able to change the "last updated time" so that all silverlight clients download the newest data the next time they check this date. However, I'm a bit confused as to how to handle the time zone issue since a if the server is in New York and the update time is set to 2010-01-01 17:00:00 and a client in Seattle checks compares it to its local time of 2010-01-01 14:00:00 it won't update and will continue to provide old data for three more hours. My solution is to always post the update time in UTC time, not with the time on the server, then make the Silverlight app check with DateTime.UtcNow. Is this as easy as it sounds or are their issues with this, e.g. that timezones are not set correctly on computers and hence the SilverlightApp does not report the correct UTC time. Can anyone say from experience how likely it is that using DateTime.UtcNow like this for cache refreshing will work in all cases? If DateTime.UtcNow is not reliable, I will just use an incremented "DataVersion" integer but there are other scenarios in which getting time zone sychronization down would make it useful to thoroughly understand how to solve this in silverlight apps.

    Read the article

  • Python: Figure out local timezone

    - by Adam Matan
    I want to compare UTC timestamps from a log file with local timestamps. When creating the local datetime object, I use something like: >>> local_time=datetime.datetime(2010, 4, 27, 12, 0, 0, 0, tzinfo=pytz.timezone('Israel')) I want to find an automatic tool that would replace thetzinfo=pytz.timezone('Israel') with the current local time zone. Any ideas?

    Read the article

  • Javascript timezone solution needed(taking into account the actual difference in UTC timestamps)

    - by user198729
    I have unix timestamps from time zone X which is not known, the current timestamp(now()) in TZ X is known 1275143019, how to approach a javascript function so that it can generate the datetime in the users current TZ in the format 2010-05-29 15:32:35 ? UPDATE I'm not a unix timestamp expert,if unix timestamp is always the same in different TZ, then I have to change the question a little,so that the current datetime in TZ X is known(like 2010-05-29 22:32:28),and the other datetime is also in this format,how to convert them to the user's TZ based on the difference between now() ? UPDATE Something strange from MySQL: On server: mysql> select now(); +---------------------+ | now() | +---------------------+ | 2010-05-29 18:34:30 | +---------------------+ 1 row in set (0.00 sec) mysql> select UNIX_TIMESTAMP(); +------------------+ | UNIX_TIMESTAMP() | +------------------+ | 1275143674 | +------------------+ 1 row in set (0.00 sec) On local: mysql> select now(); +---------------------+ | now() | +---------------------+ | 2010-05-29 22:41:30 | +---------------------+ 1 row in set (0.00 sec) mysql> select UNIX_TIMESTAMP(); +------------------+ | UNIX_TIMESTAMP() | +------------------+ | 1275144091 | +------------------+ 1 row in set (0.00 sec) Why the difference between now() (2010-05-29 22:41:30-2010-05-29 18:34:30=6hours) and UNIX_TIMESTAMP() (1275144091 - 1275143674 = 417seconds) is not the same ?

    Read the article

  • UTC-8 conversion

    - by leachianus
    Hey guys, I am grabbing a JSON array and storing it in a NSArray, however it includes JSON encoded UTF-8 strings, for example pass\u00e9 represents passé. I need a way of converting all of these different types of strings into the actual character. I have an entire NSArray to convert. Or I can convert it when it is being displayed, which ever is easiest. I found this chart http://tntluoma.com/sidebars/codes/ is there a convenience method for this or a library I can download? thanks, BTW, there is no way I can find to change the server so I can only fix it on my end...

    Read the article

  • PHP UTC Timestamp Creation

    - by Ajith
    I am using ubuntu(apache) for my php application.i need to create a timestamp for authenticated call of a webservice.In php i getting only 10 digit timestamp like 1273229733.But i need to create like 1273229613000 .How can i solve this problem.help me please.

    Read the article

  • recommended format to save time with MJD + BCD format in database

    - by pierr
    Hi, There is a time represented in MJD and BCD format with 5 bytes .I am wondering what is the recommended format to save this date-time in the sqlite database so that user can search against it ? My first attempt is to save it just as it is, that is a 5 bytes string. The user will use the same format to search and the result will be converted to unix time by the user with following code. However, later, I was suggested to save the time in the integer - the UTC time, for example. But I can not find a standard way to do the conversion. I feel this is a common issue and would like to hear your comments. time_t sidate_to_unixtime(unsigned char sidate[]) { int k = 0; struct tm tm; double mjd; /* check for the undefined value */ if ((sidate[0] == 0xff) && (sidate[1] == 0xff) && (sidate[2] == 0xff) && (sidate[3] == 0xff) && (sidate[4] == 0xff)) { return -1; } memset(&tm, 0, sizeof(tm)); mjd = (sidate[0] << 8) | sidate[1]; tm.tm_year = (int) ((mjd - 15078.2) / 365.25); tm.tm_mon = (int) (((mjd - 14956.1) - (int) (tm.tm_year * 365.25)) / 30.6001); tm.tm_mday = (int) mjd - 14956 - (int) (tm.tm_year * 365.25) - (int) (tm.tm_mon * 30.6001); if ((tm.tm_mon == 14) || (tm.tm_mon == 15)) k = 1; tm.tm_year += k; tm.tm_mon = tm.tm_mon - 2 - k * 12; tm.tm_sec = bcd_to_integer(sidate[4]); tm.tm_min = bcd_to_integer(sidate[3]); tm.tm_hour = bcd_to_integer(sidate[2]); return mktime(&tm); }

    Read the article

  • Can I speed up cygwin's fork?

    - by Andrew Aylett
    I came across a post discussing the speed of forking in Cygwin, giving an expected 'fork rate' in Windows XP of around 30-50 per-second (link) I've got a Core 2 duo (1.79GHz) which I would expect to get comparable results, but it's only managing around 8 forks per second (and sometimes a lot fewer): $ while (true); do date --utc; done | uniq -c 5 Wed Apr 21 12:38:10 UTC 2010 6 Wed Apr 21 12:38:11 UTC 2010 1 Wed Apr 21 12:38:12 UTC 2010 1 Wed Apr 21 12:38:13 UTC 2010 8 Wed Apr 21 12:38:14 UTC 2010 8 Wed Apr 21 12:38:15 UTC 2010 6 Wed Apr 21 12:38:16 UTC 2010 1 Wed Apr 21 12:38:18 UTC 2010 9 Wed Apr 21 12:38:19 UTC 2010 Can you suggest anything I might be able to do to speed things up? This machine acts a lot slower in Cygwin than others I've used before which actually were a lot slower.

    Read the article

  • Why does Java return a date in GMT-4.5 when choosing Co-ordinated Universal Time time zone in Window

    - by Simon Nickerson
    We have seen a strange issue on some Windows XP machines involving the "Co-ordinated Universal Time" time zone. Not all Windows XP machines seem to have it, but on those that do, the following simple Java program public class TimeTest { public static void main(String[] args) { System.out.println(java.util.TimeZone.getDefault()); System.out.println(new java.util.Date()); } } on JDK 1.6.0_06 prints: sun.util.calendar.ZoneInfo[id="America/Caracas",offset=-16200000,dstSavings=0,useDaylight=false,transitions=5,lastRule=null] Fri Nov 13 05:34:14 VET 2009 (i.e. 4 and a half hours behind GMT). I should add that I am based in London, and have never been to South America. :-) My questions are: Where does Java get this time zone from? I thought Co-ordinated Universal Time was supposed to be the new name for GMT. Why do some Windows machines have this time zone but not others?

    Read the article

  • How to store UTC time values in Mongo with Mongoid?

    - by Jerry Cheung
    The behavior I'm observing with the Mongoid adapter is that it'll save 'time' fields with the current system timezone into the database. Note that it's the system time and not Rail's environment's Time.zone. If I change the system timezone, then subsequent saves will pick up the current system timezone. # system currently at UTC -7 @record.time_attribute = Time.now.utc @record.save # in mongo, the value is "time_attribute" : "Mon May 17 2010 12:00:00 GMT-0700 (QYZST)" @record.reload.time_attribute.utc? # false

    Read the article

  • Is this the correct way to convert a UTC datetime string into localtime?

    - by Steve
    Is this the correct way to convert a UTC string into local time allowing for daylight savings? It looks ok to me but you never know :) import time UTC_STRING = "2010-03-25 02:00:00" stamp = time.mktime(time.strptime(UTC_STRING,"%Y-%m-%d %H:%M:%S")) stamp -= time.timezone now = time.localtime() if now[8] == 1: stamp += 60*60 elif now[8] == -1: stamp -= 60*60 print 'UTC: ', time.gmtime(stamp) print 'Local: ', time.localtime(stamp) --- Results from New Zealand (GMT+12 dst=1) --- UTC: (2010, 3, 25, 2, 0, 0, 3, 84, 0) Local: (2010, 3, 25, 15, 0, 0, 3, 84, 1)

    Read the article

  • Excessive PHP errors in Joomla

    - by Rodnower
    I have Joomla 2.5 installed on Windows 7 with Apache 2 and PHP 5. I have countless PHP errors in the log like the following: [01-Sep-2012 19:33:55 UTC] PHP Strict standards: Only variables should be assigned by reference in C:\ammon_dev\ammon\plugins\system\jquery\jquery.php on line 24 [01-Sep-2012 19:33:55 UTC] PHP Stack trace: [01-Sep-2012 19:33:55 UTC] PHP 1. {main}() C:\ammon_dev\ammon\administrator\index.php:0 [01-Sep-2012 19:33:55 UTC] PHP 2. JAdministrator->route() C:\ammon_dev\ammon\administrator\index.php:40 [01-Sep-2012 19:33:55 UTC] PHP 3. JApplication->triggerEvent() C:\ammon_dev\ammon\administrator\includes\application.php:106 [01-Sep-2012 19:33:55 UTC] PHP 4. JDispatcher->trigger() C:\ammon_dev\ammon\libraries\joomla\application\application.php:670 [01-Sep-2012 19:33:55 UTC] PHP 5. JEvent->update() C:\ammon_dev\ammon\libraries\joomla\event\dispatcher.php:161 [01-Sep-2012 19:33:55 UTC] PHP 6. call_user_func_array() C:\ammon_dev\ammon\libraries\joomla\event\event.php:71 [01-Sep-2012 19:33:55 UTC] PHP 7. plgSystemJquery->onAfterRoute() C:\ammon_dev\ammon\libraries\joomla\event\event.php:71 I tried disabling error logging in php.ini: error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT Unfortunately that does not make a difference. Joomla isn’t in debug mode, and I am sure that I’m editing the correct copy of php.ini because other changes I make to it take effect. Any ideas why I am getting so many errors or how to stop it from exploding the log?

    Read the article

  • position of options in HTML select element

    - by frenchie
    I have a element that contains options. The element is 150px wide but some of the options are wider. So when rendering, the browser shows the overflow to the right. How can I make the options list overflow to the left? JSFiddle Thanks. <select id="MySelect"> <option value="60" selected="selected"></option><option value="-60">(UTC-01:00) Azores</option> <option value="-60">(UTC-01:00) Cape Verde Is.</option><option value="0">(UTC) Casablanca</option> <option value="0">(UTC) Dublin, Edinburgh, Lisbon, London</option><option value="0">(UTC) Monrovia, Reykjavik</option> <option value="60">(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option> <option value="60">(UTC+01:00) Brussels, Copenhagen, Madrid, Paris</option> <option value="60">(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb</option> <option value="60">(UTC+01:00) West Central Africa</option> <option value="120">(UTC+01:00) Windhoek</option> </select>?????????????????????????????????????????????? ?#MySelect{ margin-top:20px; margin-left:200px; width:150px;}

    Read the article

  • How do I calculate the offset, in hours, of a given timezone from UTC in ruby?

    - by esilver
    I need to calculate the offset, in hours, of a given timezone from UTC in Ruby. This line of code had been working for me, or so I thought: offset_in_hours = (TZInfo::Timezone.get(self.timezone).current_period.offset.utc_offset).to_f / 3600.0 But, it turns out that was returning to me the Standard Offset, not the DST offset. So for example, assume self.timezone = "America/New_York" If I run the above line, offset_in_hours = -5, not -4 as it should, given that the date today is April 1, 2012. Can anyone advise me how to calculate offset_in_hours from UTC given a valid string TimeZone in Ruby that accounts for both standard time and daylight savings? Thanks!

    Read the article

  • NSDate dateFromString, how to parse 'around' UTC, GMT and User locale?

    - by RickiG
    Hi I parse some values from an xml file. There is a @"25-12-2010'T'23:40:00"string with the time and date and there is a string with the GMT offset like this @"+0200". So the above time is the 25. of December 23:40:00 in timeZone +0200 GMT. (or 21:40 UTC) I have lots of these dates with different GMT offsets. I have to display these dates as they are, i.e. They must not be changed to fit the locale of the user. So if time 1: is 22:45 +0500 then that is what I must show the user, even if the user is in a different timezone. I have all sorts of trouble with displaying, calculating and parsing these strings. If I use a dateFormatter and dateFromString the user specific GMT info will be included in the resulting NSDate meaning the above will be saved as 23:40:00 +0100 GMT because that is my phones setting and maybe 23:40:00 -0400 on a user from new New York's phone. When I subsequently do subtraction, addition and comparisons between these dates I have to keep the GMT offset around and everything gets worse if the phone switches locale settings, from when the date was parsed to when the date is displayed... Is there a way for me to extract this date from the string as UTC, then save it as an interval instead of an actual (timezone dependent) date. I know that is how dates are always saved internally. But I can't figure out how to do it with the separate GMT string and taking into account the users locale. Cheers

    Read the article

  • Time zone for Force.com API fiscal date literals?

    - by Nick
    I have a question about fiscal date literals in the Force.com API (http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_dateformats.htm): For which time zone are date ranges calculated? For example, suppose we execute the query: SELECT Id FROM Opportunity WHERE CloseDate = THIS_FISCAL_QUARTER where, according to our company's fiscal settings, THIS_FISCAL_QUARTER runs from Jan 1 to Mar 31. Does the range for THIS_FISCAL_QUARTER use... the user's time zone? For example, if the user's time zone is GMT-8, THIS_FISCAL_QUARTER = Jan 1 00:00 GMT-8 to Mar 31 23:59 GMT-8 (or Jan 1 08:00 UTC to Mar 31 07:59 UTC) the company's default time zone (according to the company profile)? For example, if the company's default time zone is GMT-8, THIS_FISCAL_QUARTER = Jan 1 00:00 GMT-8 to Mar 31 23:59 GMT-8 (or Jan 1 08:00 UTC to Mar 31 07:59 UTC) UTC? THIS_FISCAL_QUARTER = Jan 1 00:00 UTC to Mar 31 23:59 UTC something else?

    Read the article

  • get next/previous month from a Time object

    - by tcurdt
    I have a Time object and would like to find the next/previous month. Adding subtracting days does not work as the days per month vary. time = Time.parse('21-12-2008 10:51 UTC') next_month = time + 31 * 24 * 60 * 60 Incrementing the month also falls down as one would have to take care of the rolling time = Time.parse('21-12-2008 10:51 UTC') next_month = Time.utc(time.year, time.month+1) time = Time.parse('01-12-2008 10:51 UTC') previous_month = Time.utc(time.year, time.month-1) The only thing I found working was time = Time.parse('21-12-2008 10:51 UTC') d = Date.new(time.year, time.month, time.day) d >>= 1 next_month = Time.utc(d.year, d.month, d.day, time.hour, time.min, time.sec, time.usec) Is there a more elegant way of doing this that I am not seeing? How would you do it?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >