Search Results

Search found 571 results on 23 pages for 'timezone'.

Page 8/23 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Display DateTime in GridView using user's time

    - by Rachel Martin
    I have a DateTime stored in UTC time that I'd like to display to the user in their local time from within a GridView control. How can I convert my DateTime to the user's time (not my server's local time)? Here is my current field as it appears in the GridView Columns collection: <asp:BoundField DataField="RunTime" HeaderText="Run Time" SortExpression="RunTime" DataFormatString="{0:f}" />

    Read the article

  • Changing the system time zone succeeds once and then no longer changes

    - by Adam Driscoll
    I'm using the WinAPI to set the time zone on a Windows XP SP3 box. I'm reading the time zone information from the HKLM\Software\Microsoft\WindowsNT\Time Zones\<time zone name> key and then setting the time zone to the specified time zone. I enumerate the keys under the Time Zones key, grab the TZI value and stuff it into a TIME_ZONE_INFORMATION struct to be passed to SetTimeZoneInformation. All seems to work on the first pass. The time zone changes, no error is returned. The second time I perform this operation (same user, new session, on login before userinit) the call succeeds but the system does not reflect the time zone change. Neither the clock nor time stamps on files are updated to the new time zone. When I navigate to: HKLM\System\CurrentControlSet\Control\TimeZoneInformation my new time zone information is present. A couple strange things are happening when I'm setting my time zone: Also when I parse the TZI binary value from the registry to store in my TIME_ZONE_INFORMATION struct I'm noticing the struct has the DaylightDate.wDay and StandardDate.wDay field always set to 0 I tried to call GetTimeZoneInformation right after I call SetTimeZoneInformation but the call fails with a 1300 error (Not all privileges or groups referenced are assigned to the caller. ) I'm also making sure to send a WM_BROADCAST message so Explorer knows whats going on. Think it's the parsing of the byte array to the TIME_ZONE_INFORMATION struct? Or am I missing some thing else important? EDIT: Found a document stating why this is happening: here. Privilege was introduced in Vista...thanks MSDN docs... Per the Microsoft documentation I'm enabling the SE_TIME_ZONE_NAME privilege for the current processes token. But when I attempt to call LookupPriviledgeValue for SE_TIME_ZONE_NAME I get a 1313 error (A specified privilege does not exist. ).

    Read the article

  • best practice to obtain time zone for iPhone vs iPod Touch

    - by johnbdh
    I am creating an app that requires the users current time zone. If the device being used is an iPhone and the user has their Time Zone set to automatically change, I think I can be fairly confident that localTimeZone or systemTimezone will give me the correct time zone for the user's location. If on the other hand the device is an iPod Touch, the time zone returned by localTimeZone and systemTimeZone appears to always be whatever time zone is set in the Date & Time settings, regardless of the user's actual location. I tried using location services but, while the lat/long is being provided properly, the time zone offset in the timesStamp I am getting is always the same as whatever the user has set for their time zone setting. Any suggestions? John

    Read the article

  • How can a Windows program temporarily change its time zone?

    - by Rob Kennedy
    I've written a function to return the time_t value corresponding to midnight on a given day. When there is no midnight for a given day, it returns the earliest time available; that situation can occur, for example, when Egypt enters daylight-saving time. This year, the time change takes effect at midnight on the night of April 29, so the clock goes directly from 23:59 to 01:00. Now I'm writing unit tests for this function, and one of the tests should replicate the Egypt scenario. In Unix, I can accomplish it like this: putenv("TZ", "Egypt", true); tzset(); After doing that, further calls to localtime behave as if they're in Egypt instead of Minnesota, and my tests pass. Merely setting the environment variable doesn't have any effect on Windows, though. What can I do to make the unit test think it's somewhere else without affecting the rest of the programs running on the system?

    Read the article

  • Where is the iPhone's Date & Time getting it's time zone list

    - by johnbdh
    I can get a list of time zones with [NSTimeZone knownTimeZoneNames], but that only gives the time zone IDs which include one or 2 cities in each time zone. The Date & Time settings has a great list of cities and I have seen a few other apps that have the same if not similar lookup lists. Where do these lists come from?? I do need to relate a picked city to it's time zone like Date & Time does. Thanks, John

    Read the article

  • Mysql: Convert DB from local time to UTC

    - by Joernsn
    I need to convert an existing (datetime fields) db from local time ut UTC. The values are stored ad datetimes on a server with time zone CET (+1) (with summertime +2). When selecting data I use UNIX_TIMESTAMP(), which magically compensates for everything, ie, time zone shift and dst (if i've read the docs right). I'm moving the db to a new server with UTC as system time. Simply subtracting -1 H won't work, as summer time is +2. Any ideas for a clever way to do this? (using sql or some script lang)

    Read the article

  • php date() function displaying wrong time

    - by ladaghini
    I'm building a site with wordpress, and when I use the date() function on an otherwise empty file, it shows the right date. However, if I use it in a file that includes other wordpress files, the time is displayed as GMT time, so the date is off. If anyone can figure out how I can use date function without interruption from the wordpress methods, I'd appreciated it.

    Read the article

  • how to store "2010-03-26 10:13:04 Etc/GMT" mysql?

    - by kkchaitu
    Hi All, I would like to store "2010-03-26 10:13:04 Etc/GMT" value in column of type datetime. when i try to insert it i got exception SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10:13:04 Etc/GMT', at line 1 how to insert data time with time zone. Thanks in advance. please help me its urgent.

    Read the article

  • Russian time zone changes

    - by Tim Post
    As many of you know, Russia has eleven time zones, and has (or will) cut two of them. It is possible that they may end daylight savings time altogether. Does anyone know if they have cut two time zones, and if daylight savings is now a thing of the past? If so, does daylight savings end in all time zones, or just some? I maintain some software that may need to be patched and can't find two news sites that agree on if they have, or have not implemented these changes.

    Read the article

  • Consideration of cron job with respect to time

    - by charan
    Hi all, Is it possible to run my cron job according to the GMT where as, my server is cosidering IST time formats. In future is it possible to use different time zones...? To do this can anyone suggest what all steps i need to follow as i am working on linux. Thanks in advance....

    Read the article

  • Java Time Zone When Parsing DateFormat

    - by shipmaster
    I had code that parses date as follows: String ALT_DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; SimpleDateFormat sdf = new SimpleDateFormat( ALT_DATE_TIME_FORMAT); Date date = sdf.parse(requiredTimeStamp); And it was working fine, suddenly, this stopped working. It turns out an admin made some config changes on the server and the date is currently being returned as "2010-12-27T10:50:44.000-08:00" which is not parse-able by the above pattern. I have two questions: The first would be what pattern would parse the date being returned by the JVM in the format above (specifically, just '-08:00' as the time zone)? And second, where exactly would one change such settings on a linux RHEL 5 server so that we are aware of such changes in the future?

    Read the article

  • Mapping US zip code to time zone

    - by Doug Kavendek
    When users register with our app, we are able to infer their zip code when we validate them against a national database. What would be the best way to determine a good potential guess of their time zone from this zip code? We are trying to minimize the amount of data we explicitly have to ask them for. They will be able to manually set the time zone later if our best guess is wrong. I realize zip codes won't help with figuring out the time zone outside the US, but in that case we'd have to manually ask anyway, and we deal predominantly with the US regardless. I've found a lot of zip code databases, and so far only a few contain time zone information, but those that do are not free, such as this one. If it's absolutely necessary to pay a subscription to a service in order to do this, then it will not be worth it and we will just have to ask users explicitly. Although language isn't particularly relevant as I can probably convert things however needed, we're using PHP and MySQL.

    Read the article

  • Safely convert UTC datetimes to local time (based on TZ) for calculations?

    - by James
    Following from my last question which @Jon Skeet gave me a lot of help with (thanks again!) I am now wondering how I can safely work with date/times, stored as UTC, when they are converted back to Local Date/Time. As Jon indicated in my last question using DateTimeOffset represents an instant in time and there is no way to predict what the local time would be say a minute later. I need to be able to do calculations based on these date/times. So how can I assure when I pull the dates from the database, convert them to local date/time and do specific calculations on them they are going to be accurate?

    Read the article

  • Python - calendar.timegm() vs. time.mktime()

    - by ibz
    I seem to have a hard time getting my head around this. What's the difference between calendar.timegm() and time.mktime()? Say I have a datetime.datetime with no tzinfo attached, shouldn't the two give the same output? Don't they both give the number of seconds between epoch and the date passed as a parameter? And since the date passed has no tzinfo, isn't that number of seconds the same? >>> import calendar >>> import time >>> import datetime >>> d = datetime.datetime(2010, 10, 10) >>> calendar.timegm(d.timetuple()) 1286668800 >>> time.mktime(d.timetuple()) 1286640000.0 >>>

    Read the article

  • How to set the time for a specific local in javascript

    - by Joao
    Hi, i have a problem, and maybe someone can help me, i will explain... i have the in javascript "var date= new date();" and its give me the local time (browser time) but i want force this data/time for a especific local... for example... Spain. i want everytime that someone enter in the page (from others country) the date need be the spanish hour. i found some soluction but the problem is the summer time and winter time... we have offset variations because some time is +1 hours and others is +2.... someone can help me in one soluction? thanks [email protected]

    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

  • How to represent datetime of deifferent time zomes in C#

    - by Mohoch
    Hi. I have a .NET WebService (written in C#), that is supposed to serve people around the world. With each request I get the user's datetime in his own time zone with the format : "yyyy/MM/dd HH:mm ZZZZ". I have to convert the string to something representing the original date and time and specifying the time zone in GMT. I have to make some logical calculations and keep it in the database. The regular DateTime doe's not support this. it does not have a property specifying the time zone. When I try to convert my string into DateTime - it simply converts it to my local time. I do not want to keep my time in UTC, because I have some logic that has to run per user by his own time. Does anyone know a C# class that handles this? Thanks!

    Read the article

  • PHP/MySQL time zone migration

    - by El Yobo
    I have an application that currently stores timestamps in MySQL DATETIME and TIMESTAMP values. However, the application needs to be able to accept data from users in multiple time zones and show the timestamps in the time zone of other users. As such, this is how I plan to amend the application; I would appreciate any suggestions to improve the approach. Database modifications All TIMESTAMPs will be converted to DATETIME values; this is to ensure consistency in approach and to avoid having MySQL try to do clever things and convert time zones (I want to keep the conversion in PHP, as it involves less modification to the application, and will be more portable when I eventually manage to escape from MySQL). All DATETIME values will be adjusted to convert them to UTC time (currently all in Australian EST) Query modifications All usage of NOW() to be replaced with UTC_TIMESTAMP() in queries, triggers, functions, etc. Application modifications The application must store the time zone and preferred date format (e.g. US vs the rest of the world) All timestamps will be converted according to the user settings before being displayed All input timestamps will be converted to UTC according to the user settings before being input Additional notes Converting formats will be done at the application level for several main reasons The approach to converting time zones varies from DB to DB, so handing it there will be non-portable (and I really hope to be migrating away from MySQL some time in the not-to-distant future). MySQL TIMESTAMPs have limited ranges to the permitted dates (~1970 to ~2038) MySQL TIMESTAMPs have other undesirable attributes, including bizarre auto-update behaviour (if not carefully disabled) and sensitivity to the server zone settings (and I suspect I might screw these up when I migrate to Amazon later in the year). Is there anything that I'm missing here, or does anyone have better suggestions for the approach?

    Read the article

  • new Date() timezone in grails

    - by xain
    Hi, I'm inserting a date in grails using "new Date()" and when I read the record, it's three hours ahead the O.S.'s system time. Is there a configuration to fix this ? Thanks in advance.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >